index de foreach kotlin

for ((index, value) in array.withIndex()) {
    println("the element at $index is $value")
}
Coder Thirteen