Skip to content

Instantly share code, notes, and snippets.

@bittercoder
Last active December 16, 2015 22:19
Show Gist options
  • Save bittercoder/5506001 to your computer and use it in GitHub Desktop.
Save bittercoder/5506001 to your computer and use it in GitHub Desktop.
Turns out there's a maximum limit on setInterval after which it will fire immediately, rather then what you expect (which is to never fire) on chrome/firefox.
var a = function() {
alert('bang!');
}
var signedIntMax = 2147483647;
var signedIntMaxPlus1 = signedIntMax+1; // will cause bang immediately on webkit/firefox but not IE
setInterval(a, signedIntMaxPlus1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment