Kotlin HashSet sumOf()
Syntax & Examples


Syntax of HashSet.sumOf()

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

fun <T> Iterable<T>.sumOf(selector: (T) -> Double): Double

This sumOf() extension function of HashSet returns the sum of all values produced by selector function applied to each element in the collection.