A for loop is executed like so:
- Execute the first expression. In this case that declares a variable called
i
and sets its value to one. - Execute the second expression. If it evaluates to true, jump to the inside of the loop.
- After the body of the loop has completed, execute the final expression. In this case that adds one to
i
. - Jump back to step 2 and rinse and repeat until the second expression evaluates to false.
In short, all a foo loop does is iterate until the second expression evaluates to false (in this case, if i is greater than or equal to 100), which is in this case caused by adding one onto i
.