文章目录 1 问题2 方式一3 方式二(传统)4 心得 1 问题 记录一下使用for循环主要是通过of 会更加简洁 2 方式一 let names = ['a','b','c']; for(let item of names){ console.log(item); } 3 方式二(传统) let names = ['a','b','c']; for(let i; i < names.length; i++){ console.log(names[i]); } 4 心得 还有很多其它写法,但我觉得只要能够解决问题,就是好方法,没有必要刻意去简化,更多地去思考自己的问题