题解 | #计时器#
计时器
http://www.nowcoder.com/practice/72c661d926494bd8a50608506915268c
{"css":"","js":"function count(start, end) {\n console.log(start++);\n var timer = setInterval(function(){\n if(start<=end){\n console.log(start++)\n }else{\n clearInterval(timer);\n }\n },100)\n return{\n cancel(){\n clearInterval(timer);\n }\n }\n}","html":"","libs":[]}