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