Overview - For loop with step and downTo
What is it?
A for loop in Kotlin lets you repeat actions multiple times. Using 'step' changes how much the loop counter increases each time. The 'downTo' keyword lets the loop count backwards instead of forwards. Together, they help control exactly how the loop runs.
Why it matters
Without 'step' and 'downTo', loops only count up by one, which limits what you can do. These features let you skip numbers or count down, making loops more flexible and powerful. This saves time and code when working with sequences or ranges.
Where it fits
You should know basic Kotlin syntax and simple for loops before learning this. After this, you can explore while loops, nested loops, and functional operations like map and filter.