enhanced for loop kotlin code example
Example 1: kotlin simple for loop
val names = listOf("Jack", "John", "Tim")
for(name in names){
println(name)
}
Example 2: kotlin iterate array
val names = listOf("Anne", "Peter", "Jeff")
for (name in names) {
println(name)
}