Loops
JavaScript supports the following types of loop:
Key Points
-
Use the break statement to terminate the current while or for loop and continue executing the statements after the loop..
-
Use the continue statement to stop executing the current iteration and continue with the next iteration.
Important:
Be careful not to create endless loops. Make sure your loops always have an exit condition!