Kotlin HashSet withIndex()
Syntax & Examples


Syntax of HashSet.withIndex()

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

fun <T> Iterable<T>.withIndex(): Iterable<IndexedValue<T>>

This withIndex() extension function of HashSet returns a lazy Iterable that wraps each element of the original collection into an IndexedValue containing the index of that element and the element itself.