array reduce

[1, 2, 3].reduce((total, n) => {
    console.log(total, n) 
    return total + n;
}, 10);

 

posted @ 2017-08-25 14:27  大智ywz  阅读(107)  评论(0)    收藏  举报