js遍历数组和对象
本文最后更新于:2023年12月5日 晚上
- for in 这个方法适合遍历对象,如果用来遍历数组,遍历出来的索引是字符串
- forEach( (value, i) => { } ),遍历数组,性能不佳
- map,遍历数组,返回新数组
- for of 当不需要使用数组的索引的时候, 使用 for of 遍
js遍历数组和对象
http://blog.lujinkai.cn/前端/JavaScript/遍历数组和对象/
本文最后更新于:2023年12月5日 晚上