setIntervalとsetTimeoutの違い
setTimeout
var i = 0; function show(){ console.log(i++); setTimeout (function(){ show(); },1000); } show();
setInterval
var i = 0; function show(){ console.log(i++); } setInterval (function(){ show(); },1000); show();
setTimeout
var i = 0; function show(){ console.log(i++); setTimeout (function(){ show(); },1000); } show();
setInterval
var i = 0; function show(){ console.log(i++); } setInterval (function(){ show(); },1000); show();