摘要: reduce() 方法接收一个函数作为累加器,数组中的每个值(从左到右)开始缩减,最终计算为一个值。 const arr= [1, 2, 3, 4]; arr.reduce((total,num)=>{ console.log(total,num); return total+num; },0) 此 阅读全文
posted @ 2020-04-22 20:15 软妹酸 阅读(112) 评论(0) 推荐(0) 编辑