onEach

inline fun <T, C : Iterable<T>> C.onEach(action: (T) -> Unit): C(source)

Performs the given action on each element and returns the collection itself afterwards.

Since Kotlin

1.1

inline fun <K, V, M : Map<out K, V>> M.onEach(action: (Map.Entry<K, V>) -> Unit): M(source)

Performs the given action on each entry and returns the map itself afterwards.

Since Kotlin

1.1