Kotlin HashSet reduceOrNull()
Syntax & Examples


Syntax of HashSet.reduceOrNull()

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

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

This reduceOrNull() 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.