创建一个新的的定时器,取到返回值
然后创建循环清除从1到返回值的定时器
代码:
let end = setInterval(function () { }, 10000); for (let i = 1; i <= end; i++) { clearInterval(i); }
参考自此