onEachIndexed
inline
fun
<
T
>
Array
<
out
T
>
.
onEachIndexed
(
action
:
(
index
:
Int
,
T
)
->
Unit
)
:
Array
<
out
T
>
(source)
inline
fun
ShortArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
Short
)
->
Unit
)
:
ShortArray
(source)
inline
fun
FloatArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
Float
)
->
Unit
)
:
FloatArray
(source)
inline
fun
DoubleArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
Double
)
->
Unit
)
:
DoubleArray
(source)
inline
fun
BooleanArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
Boolean
)
->
Unit
)
:
BooleanArray
(source)
@ExperimentalUnsignedTypes
inline
fun
ULongArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
ULong
)
->
Unit
)
:
ULongArray
(source)
@ExperimentalUnsignedTypes
inline
fun
UByteArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
UByte
)
->
Unit
)
:
UByteArray
(source)
@ExperimentalUnsignedTypes
inline
fun
UShortArray
.
onEachIndexed
(
action
:
(
index
:
Int
,
UShort
)
->
Unit
)
:
UShortArray
(source)
Performs the given action on each element, providing sequential index with the element, and returns the array itself afterwards.
Parameters
action
- function that takes the index of an element and the element itself
and performs the action on the element.
Performs the given action on each element, providing sequential index with the element, and returns the collection itself afterwards.
Parameters
action
- function that takes the index of an element and the element itself
and performs the action on the element.
Performs the given action on each entry, providing sequential index with the entry, and returns the map itself afterwards.
Parameters
action
- function that takes the index of an entry and the entry itself
and performs the action on the entry.