Kotlin HashSet flatMapIndexed()
Syntax & Examples


Syntax of HashSet.flatMapIndexed()

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

fun <T, R> Iterable<T>.flatMapIndexed( transform: (index: Int, T) -> Iterable<R> ): List<R>

This flatMapIndexed() extension function of HashSet returns a single list of all elements yielded from results of transform function being invoked on each element and its index in the original collection.