Just like continue is used to break current iteration and proceed with the next, how can I break current iteration within setInterval() in JavaScript and proceed with the next interval without waiting?
var intervalID = window.setInterval( function() {
if(conditionIsTrue) {
// Break this iteration and proceed with the next
// without waiting for 3 seconds.
}
}, 3000 );
You could “simply” (or not so simply) clear the interval, and re-create it:
Here’s a demo/test Fiddle.