kotlin.collections.onEach

onEach

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

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

登录查看完整内容