Kotlin HashSet flatMapIndexedTo()
Syntax & Examples


Syntax of HashSet.flatMapIndexedTo()

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

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

This flatMapIndexedTo() extension function of HashSet appends all elements yielded from results of transform function being invoked on each element and its index in the original collection, to the given destination.