数组中 reduce累计运算

let arr = [1,2,3,4];

let sum = (a, b) => a + b;

arr.reduce(sum, 0);

最后输出10

原文地址:https://www.cnblogs.com/rusr/p/10000721.html