downTo function
suggest changeif you want to iterate over numbers in reverse order? It’s simple. You can use the downTo() function defined in the standard library
for (i in 4 downTo 1) print(i) // prints "4321"
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents