In contrast to
while loops, Kotlin’s
for loops work a bit differently than you may be used to from other languages.
for loops are different from many other languages because they’re used in the same manner as for-each loops (or for-in loops). Thus, you always give an iterable to the
for loop over which it iterates: