Kotlin HashSet scan()
Syntax & Examples


Syntax of HashSet.scan()

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

fun <T, R> Iterable<T>.scan( initial: R, operation: (acc: R, T) -> R ): List<R>

This scan() extension function of HashSet returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.