What is the syntax of a decrementing for() loop?
I would like to do something like the following without getting a compilation error:
for ndx in 5...4 {
print("do something")
}
What is the syntax of a decrementing for() loop?
I would like to do something like the following without getting a compilation error:
for ndx in 5...4 {
print("do something")
}
This prints the value of i in reverse order:
for i in (1...10).reversed() {
print(i)
}