reduce

179 阅读1分钟
var newtotal = [2,4,8].reduce(function (sum, value) {
		return sum + value;
	}, 0);

console.log(newtotal) // 14