📌  相关文章
📜  javascript 从数组返回对象属性 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:18.477000             🧑  作者: Mango

代码示例3
//Getting One Value from an Array of Items or sum of array
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var total = numbers.reduce(function(total, current) {
    return total + current;
}, 0);

console.log(total);