mapIndexedTo

abstract fun <R, C : MutableCollectionWrapper<in R>> mapIndexedTo(destination: C, transform: (index: Int, PT) -> R): C

将每个元素转换为一个新元素,并提供元素索引,并将结果添加到目标集合中.

参考 kotlin.collections.mapIndexedTo

Return

目标集合

Parameters

destination

目标集合

transform

用于将每个元素及其索引转换为新元素的函数