The below Kotlin program will loop and print out each item in the books’ array.
fun main(args: Array<String>) {
val books : Array<String> = arrayOf("Jungle", "Bird", "Cat")
for (item in books) {
println(item)
}
}
The above program will display the below outcome:-
Jungle Bird Cat