This commit is contained in:
Alexander 2017-09-25 20:29:22 +03:00 committed by GitHub
parent d39750fc29
commit 6b61befda3

View file

@ -8,8 +8,8 @@ for (let i = 0; i < 5; i++) alert( i );
That can be easily deducted from the algorithm of `for`:
1. Execute once `i=0` before everything (begin).
2. Check the condition `i<5`
1. Execute once `i = 0` before everything (begin).
2. Check the condition `i < 5`
3. If `true` -- execute the loop body `alert(i)`, and then `i++`
The increment `i++` is separated from the condition check (2). That's just another statement.