01 / 06
Three parts, scattered about
When you counted with while, you always wrote the same three things.
- the start (
let i = 1) … before the repetition - the condition to carry on (
i <= 3) … in the brackets ofwhile - the update (
i++) … inside the{ }
Because those three sit apart from each other, it is easy to forget the update.