1var objs = [
2 {name: "Peter", age: 35},
3 {name: "John", age: 27},
4 {name: "Jake", age: 28}
5];
6
7objs.reduce(function(accumulator, currentValue) {
8 return accumulator + currentValue.age;
9}, 0); // 35 + 27 + 28 = 90
1var arr = [{x:1}, {x:2}, {x:4}];
2arr.reduce(function (acc, obj) { return acc + obj.x; }, 0); // 7
3console.log(arr);