📜  数组对象到一个属性的数组 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:21.046000             🧑  作者: 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);