I have something like this:
$scope.traveler = [ { description: \'Senior\', Amount: 50}, { description: \'Senior\', Amount: 50},
Here is a one-liner using ES6 arrow functions.
const sumPropertyValue = (items, prop) => items.reduce((a, b) => a + b[prop], 0); // usage: const cart_items = [ {quantity: 3}, {quantity: 4}, {quantity: 2} ]; const cart_total = sumPropertyValue(cart_items, 'quantity');