数组的reduce方法 案例:const arry = [1,2,3,4] 计算数组中所有基数的和 const totle=arry.reduce((pre,item)=>{ return pre +(item%2===1?item:0) },0)