为什么里面是Var的时候,输出五次5,里面是let的时候,输出0,1,2,3,4呢?
for(var i =0; i<5; i++) { setTimeout(function(){ console.log(i); },1000);}
相关分类