Open Liudongge opened 7 years ago
http://www.imooc.com/article/17720?block_id=tuijian_wz
let arr = [{key:'001'}, {key:'002'}] for(let item in arr) console.log(item) // 0 1 for(let item of arr) console.log(item) // {key: "001"} {key: "002"}
for in遍历的是数组的索引 for of遍历的是数组元素值
http://www.imooc.com/article/17720?block_id=tuijian_wz