Hacker News new | past | comments | ask | show | jobs | submit login

Iterator-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)
    }



Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: