Kotlin HashSet mapIndexedTo()
Syntax & Examples


Syntax of HashSet.mapIndexedTo()

The syntax of HashSet.mapIndexedTo() extension function is:

fun <T, R, C : MutableCollection<in R>> Iterable<T>.mapIndexedTo( destination: C, transform: (index: Int, T) -> R ): C

This mapIndexedTo() extension function of HashSet applies the given transform function to each element and its index in the original collection and appends the results to the given destination.