Kotlin HashSet foldIndexed()
Syntax & Examples
Syntax of HashSet.foldIndexed()
The syntax of HashSet.foldIndexed() extension function is:
fun <T, R> Iterable<T>.foldIndexed( initial: R, operation: (index: Int, acc: R, T) -> R ): R
This foldIndexed() extension function of HashSet accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original collection.