Using the for loop to iterate through an array of values can be done as follows:
var animals = arrayOf("Cat", "Lion");
...
for (index in animals.indices) {
println("This is a great animal : ${animals[index]}")
}
Here, the animals array has an indices property that itself is an array of Int, which can be used to loop through each index and print the value of that index.