数组中 reduce累计运算

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

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

arr.reduce(sum, 0);

最后输出10spa

相关文章
相关标签/搜索