forEachIndexed

abstract fun forEachIndexed(action: (index: Int, T) -> Unit)

对此数组的每个元素及其索引执行给定的 action。

参考 kotlin.collections.forEachIndexed

Parameters

action

要执行的操作