operators
i++ 优先级高于 ++i
loops
differences
- A
forloop is used when you know the number of iterations the loop needs to make. - A
whileloop can be used when you need your loop to run an unknown number of times until a specific condition is met. for/in- loops through the properties of an object.while- loops through a block of code while a specified condition is true.do/while- loops through a block of code once, and then repeats the loop while a specified condition is true.
skip loops
The
breakstatement “jumps out” of a loop.The
continuestatement “jumps over” one iteration in the loop.