The forEachIndex function evaluates each element of the list and provides the element's index:
println("Print elements with index")
numbers.forEachIndexed { index, element -> println("Element $element at index $index") }
The forEachIndex function evaluates each element of the list and provides the element's index:
println("Print elements with index")
numbers.forEachIndexed { index, element -> println("Element $element at index $index") }
18.219.236.70