var interval_id = window.setInterval(()=>{}, 99999);
for (var i = 0; i < interval_id; i++)
window.clearInterval(i);
// Get a reference to the last interval + 1
const interval_id = window.setInterval(function(){}, Number.MAX_SAFE_INTEGER);
// Clear any timeout/interval up to that id
for (let i = 1; i < interval_id; i++) {
window.clearInterval(i);
}