fun main() { val letters = listOf("a", "b", "c") // destructure each (index, value) pair for ((i, c) in letters.withIndex()) { println("$i: $c") } }
withIndex pairs position with item