常用的数组遍历方法forEach,filter,some,every,map,find,reduce的用法与区别
-forEach等同于for循环letarr=[1,2,3,4,5]leta=arr.forEach((val,index)=>{arr[index]+=1returnindex})console.log(a)//undefinedconsole.log(arr)//[2,3,4,5,6]mapletarr=[1,2,3,4,5]letarr1=arr.map((val,index)=>{retu