how to write for loop in kotlin code example
Example 1: kotlin iterate array
val names = listOf("Anne", "Peter", "Jeff")
for (name in names) {
println(name)
}
Example 2: for loop kotlin
for (x in 0..10) println(x)
val names = listOf("Anne", "Peter", "Jeff")
for (name in names) {
println(name)
}
for (x in 0..10) println(x)