reduce 刘同玉 2018-01-28 179 阅读1分钟 var newtotal = [2,4,8].reduce(function (sum, value) { return sum + value; }, 0); console.log(newtotal) // 14