onEach

Common
JVM
JS
Native
1.4
inline fun <T> Array<out T>.onEach(
    action: (T) -> Unit
): Array<out T>
inline fun ByteArray.onEach(
    action: (Byte) -> Unit
): ByteArray
inline fun ShortArray.onEach(
    action: (Short) -> Unit
): ShortArray
inline fun IntArray.onEach(action: (Int) -> Unit): IntArray
inline fun LongArray.onEach(
    action: (Long) -> Unit
): LongArray
inline fun FloatArray.onEach(
    action: (Float) -> Unit
): FloatArray
inline fun DoubleArray.onEach(
    action: (Double) -> Unit
): DoubleArray
inline fun BooleanArray.onEach(
    action: (Boolean) -> Unit
): BooleanArray
inline fun CharArray.onEach(
    action: (Char) -> Unit
): CharArray
@ExperimentalUnsignedTypes inline fun UIntArray.onEach(
    action: (UInt) -> Unit
): UIntArray
@ExperimentalUnsignedTypes inline fun ULongArray.onEach(
    action: (ULong) -> Unit
): ULongArray
@ExperimentalUnsignedTypes inline fun UByteArray.onEach(
    action: (UByte) -> Unit
): UByteArray
@ExperimentalUnsignedTypes inline fun UShortArray.onEach(
    action: (UShort) -> Unit
): UShortArray

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

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.