i have a setInterval() function which is used as follows
setInterval(function(){
if(window.document.drops.isFinished()){
//I want to exit the setInterval() on executing this if
}
},1000);
or tell me what is the method to exit.(In java we use System.exit(0))
var timerId = setInterval(function(){
if(window.document.drops.isFinished()){
clearInterval(timerId);
}
},1000);
If the if
it's not the last thing in the function and you want to "break" the execution, maybe you want to also add a return;
statement after the clearInterval
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With