Control Flow
Conditional Statements
If / else
Switch / case
Conditional operator
Iteration Statements
For loops
Foreach loops
Iterates over elements of a numerical object. In other words, it has a list nature--like arrays or strings.
While loops
Do-while loops
The only difference with a do-while loop is that the code block is executed at least once because the condition is always checked after the code block runs.
Break and continue
For any of these control flow statements, we have access to the break and continue keywords. break
will break out of the loop or flow. continue
will move onto the next iteration.
Last updated