zepto - reduce

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce

 

var ss = [0, 1, 2, 3, 4].reduce(function (previousValue, currentValue, index, array) {
        return previousValue + currentValue;
    });
    console.log(ss);

 

posted @ 2014-12-16 17:30  小猩猩君  阅读(280)  评论(0编辑  收藏  举报