📜  从对象数组映射属性 javascript 代码示例

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

代码示例2
//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);