We had covered Break and Continue statements earlier. But let us revisit it again to strengthen our understanding.
Javascript Break Statement
A javascript break statement is used to stop the normal execution of a loop. The loop can be a for loop or a while loop.
Let us take a look at for loop, and see how we can stop its normal execution. Take a look at the following example where
we wish to break the execution of the for loop when value of i reaches 5. Normaly the loop would have executed till the value of i
reaches to 10.
The continue statement in a for loop keyword causes flow of control to immediately jump to the update statement. The continue statement is helpful if we want to stop
the normal flow of the control return to the loop without executing the statements WRITTEN AFTER the continue statement.