Kotlin HashSet flatMap()
Syntax & Examples


Syntax of HashSet.flatMap()

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

fun <T, R> Iterable<T>.flatMap( transform: (T) -> Iterable<R> ): List<R>

This flatMap() extension function of HashSet returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.