题解 | #计时器#
计时器
https://www.nowcoder.com/practice/72c661d926494bd8a50608506915268c
function count(start, end) { console.log(start) let timer = setInterval(()=>{ console.log(++start) if (start >= end) { clearInterval(timer) } }, 100) return { cancel: () => { clearInterval(timer) }, } }