摘要: var j = 0 for(let i =0;i<2;i++,j++){ setTimeout(function(){ console.log(i,j); },1000) } // 0 2 // 1 2 1、因为let有自己的作用域块,所以在for循环表达式中使用let其实就等价于在代码块中使用le 阅读全文
posted @ 2021-02-22 17:01 xujing123 阅读(298) 评论(0) 推荐(0) 编辑