W3cubDocs

/Kotlin

forEach

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

Performs the given action on each entry.

inline fun <T> Array<out T>.forEach(action: (T) -> Unit)
inline fun ByteArray.forEach(action: (Byte) -> Unit)
inline fun ShortArray.forEach(action: (Short) -> Unit)
inline fun IntArray.forEach(action: (Int) -> Unit)
inline fun LongArray.forEach(action: (Long) -> Unit)
inline fun FloatArray.forEach(action: (Float) -> Unit)
inline fun DoubleArray.forEach(action: (Double) -> Unit)
inline fun BooleanArray.forEach(action: (Boolean) -> Unit)
inline fun CharArray.forEach(action: (Char) -> Unit)
inline fun <T> Iterable<T>.forEach(action: (T) -> Unit)

Performs the given action on each element.

inline fun <T> Iterator<T>.forEach(operation: (T) -> Unit)

Performs the given operation on each element of this Iterator.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/for-each.html