Interrupting Loops
Using continue inside of a loop is completely unnecessary and just makes the processing harder to follow.
The continue statement simply bypasses the rest of the processing for this time around the loop.
This can easily be rewritten to do away with the continue and make the code easier to read.
As you can see, simply reversing the test in the if statement does away with the need for continue.
In many instances it is also possible to avoid using break inside a loop by moving the test preceding the break statement into the loop termination test itself and simply using the 'or' operator || between it and the other conditions. Avoiding break as much as possible (outside of switch statements) is useful for making your code more readable since it is not always obvious to which block of code a given break statement applies.
The continue statement simply bypasses the rest of the processing for this time around the loop.
for (var i = x.length - 1; i >= 0; i--) { ... if (x == y) continue; xnoty(); ... }
This can easily be rewritten to do away with the continue and make the code easier to read.
for (var i = x.length - 1; i >= 0; i--) { ... if (x != y) { xnoty(); ... } }
As you can see, simply reversing the test in the if statement does away with the need for continue.
In many instances it is also possible to avoid using break inside a loop by moving the test preceding the break statement into the loop termination test itself and simply using the 'or' operator || between it and the other conditions. Avoiding break as much as possible (outside of switch statements) is useful for making your code more readable since it is not always obvious to which block of code a given break statement applies.
Source...