ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
一、数组的扩展方法1:array.map的用法constarr=[1,2,3,4];constnewarr=arr.map(item=>item+2);console.log(newarr);2:array.filter()过滤constarr=[1,2,3,4,5,6,7];constnewarr=arr.filter(item=>item%2==0);console.log(newarr);3