|
In Kotlin, there is only one syntactical form of the for loop. It can be used on anything that implements the Iterable<T> interface.
|
|
|
For example, on lists or arrays.
|
val someNumbers = listOf(11, 13, 19)
|
|
Ranges.
|
|
|
Maps.
|
"Last name" to "van Nieuwpoort",
for ((key, value) in myMap) {
println(key + ": " + value)
|