I have the following JSON structure.
var fooArray =
[{ name: 'firstValue',
price1: 20,
price2: 11
},
{ name: 'secondValue',
price1: 54,
price2: 13
},
{ name: 'thirdValue',
price1: 3,
price2: 6
}]
How can I sum up the values in the object array? (other than using a for loop)
{price1: 77,
price2: 28}