kotlin-stdlib / kotlin.collections / onEach onEach Common JVM JS Native 1.1 inline fun <T, C : Iterable<T>> C.onEach( action: (T) -> Unit): C Performs the given action on each element and returns the collection itself afterwards. Common JVM JS Native 1.1 inline fun <K, V, M : Map<out K, V>> M.onEach( action: (Entry<K, V>) -> Unit): M Performs the given action on each entry and returns the map itself afterwards.