Check out example codes for "while loop kotlin". It will help you in understanding the concepts better.

Code Example 1

for (item in collection) print(item)

Code Example 2

val names = listOf("Jack", "John", "Tim")
for(name in names){
	println(name)
}

Learn ReactJs, React Native from akashmittal.com