I have the following code:
var focusIntervalObj = setInterval(function(){
focusDelayCaused++;
console.log(focusDelayCaused);
}, 100);
clearInterval(focusIntervalObj);
I am have a firebug installed.
I am expecting this code to log the value of focusDelayCaused.
But when I execute, it doesn’t do so, and also the clearInterval() simply returns undefined.
Please guide.
You are setting the interval and clearing it before it fires.
That might be what you are thinking. Which would be simpler as: