If you have setInterval(change(), 99999999);
, you end up calling the change()
function and pass the return value to its setInterval()
function. You need to delay the execution of change()
by wrapping it in a function.
setInterval(function() { change() }, 9999999);
Or you can delay it by passing setInterval()
only to the function itself, without calling it.
setInterval(change, 9999999);
Or it works. I personally find the first, a little clearer about the intention, than the second.
source share