setTimeout实现setInterval
function haha(){
console.log("haha");
var time = setTimeout(haha,1000);
}
var time = setTimeout(haha,1000);
setInterval实现setTimeout
function haha(){
console.log("haha");
clearInterval(time);
}
var time = setInterval(haha,1000);