onEach

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

Platform and version requirements: Kotlin 1.1

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

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

Platform and version requirements: Kotlin 1.1

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