Kotlin HashSet forEachIndexed()
Syntax & Examples


Syntax of HashSet.forEachIndexed()

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

fun <T> Iterable<T>.forEachIndexed( action: (index: Int, T) -> Unit)

This forEachIndexed() extension function of HashSet performs the given action on each element, providing sequential index with the element.