Today I encountered an interesting problem with window.setInterval. When used with a sufficiently large delay (in this case the number of milliseconds in 30 days) it executes every second instead of every 30 days. Tested in latest Chrome and Firefox.
window.setInterval(function() {
document.getElementById("first").innerHTML = new Date().toString();
}, 5000);
window.setInterval(function() {
document.getElementById("second").innerHTML = new Date().toString();
}, 2592000000);
I couldn't find any authoritative documentation on the max value of a delay in setInterval, and the MDN documentation doesn't mention anything. Other sources online suggest that delay should be able to accommodate any signed 32-bit integer.
Does the delay parameter in window.setInterval have a maximum value and what is it?