3 ms·
I never looked at Swift, but for example how do you wright 10 times "hello world" on the command line if you don't have for loops ? You could do it with a whil
by jmnicolas 7y ago
I never looked at Swift, but for example how do you wright 10 times "hello world" on the command line if you don't have for loops ?
You could do it with a while loop (if it exists in Swift) but I'm at a loss as to why you would remove a for loop from a programming language.
- NobodyNada 7y agoIterator-style loops are much clearer and more concise in almost all cases. In this case you can iterate over a range: for i in 0..<10 { print(i) }