摘要: ES6新增的常用数组方法 let arr = [1, 2, 3, 2, 1]; 一 forEach => 遍历数组 arr.forEach((v, i) => { console.log(v, i); }); 二 map => 使用一个数组, 利用某规则映射得到一个新数组 let mapArr = 阅读全文
posted @ 2018-03-03 10:58 喵小姐随笔 阅读(2449) 评论(0) 推荐(1) 编辑