onEachIndexed
Performs the given action on each element, providing sequential index with the element, and returns the array itself afterwards.
Since Kotlin
1.4Parameters
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.
Since Kotlin
1.4Parameters
action
function that takes the index of an element and the element itself and performs the action on the element.
inline fun <K, V, M : Map<out K, V>> M.onEachIndexed(action: (index: Int, Map.Entry<K, V>) -> Unit): M(source)
Performs the given action on each entry, providing sequential index with the entry, and returns the map itself afterwards.
Since Kotlin
1.4Parameters
action
function that takes the index of an entry and the entry itself and performs the action on the entry.