📜  停止间隔 javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:26.129000             🧑  作者: Mango

代码示例6
let countBegin = 0;
var secCounter = window.setInterval( function() {
    countBegin++;
    console.log(countBegin);

    if ( countBegin >= 10) {
        window.clearInterval( secCounter);
    }
}, 1000)