JS中的 map, filter, some, every, forEach, for in, for of 用法总结
1.map//有返回值,返回一个新的数组,每个元素为调用func的结果。letlist=[1,2,3,4,5];letother=list.map((d,i)=>{returnd*2;});console.log(other);//[2,4,6,8,10]2.filter//有返回值,返回一个符合func条件的元素数组letlist=[1,2,3,4,5];letother=list.filter