0
Proper Syntax of ClearInterval?
I have a Javascript code, what is the appropriate syntax for calling a ClearInterval function on a setinterval?
3 odpowiedzi
+ 1
var interval = setInterval(DoStuff, 20);
clearInterval(interval);
+ 3
if you assign the setInterval() function to a variable, you can use that variable to clear it like in Jason Edelson 's example