Kotlin HashSet reduce()
Syntax & Examples


Syntax of HashSet.reduce()

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

fun <S, T : S> Iterable<T>.reduce( operation: (acc: S, T) -> S ): S

This reduce() extension function of HashSet accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.