We can use a javascript break and continue statements to either exit a loop or skipping iteration of
a loop.
Let's start with the break statement in this example.
We've declared a variable I next we have a for loop that sets the initial value of Ida 0 and defines
our loop to execute as long as I remains under 10.
So from 0 to 9 we then have an if statement that will stop the loop.
If the value of i it's 3 and that's what the brake statement allows us to do in our web browser we can
confirm that the loop did stop.
When I it's 3 you can see it.
We only have the value 0 1 in 2 output.
If we replace the brake statement with a continuous statement
we can skip an iteration of the loop when the value is equal to three the loop will continue as normal
after the skipped iteration.
So you can see that we go to 0 1 2 3 is skipped and then the loop continues onward until until the value
9.