Kotlin 2 · Collections and lambdas
Loop over a map
Destructure entries and ranges in for loops.
for ((name, age) in ages) println("$name is $age")
for (i in 1..3) println(i)
Official Kotlin 2 documentation
Kotlin 2 · Collections and lambdas
Destructure entries and ranges in for loops.
for ((name, age) in ages) println("$name is $age")
for (i in 1..3) println(i)
Official Kotlin 2 documentation
Was this page helpful?