I have something like this:
$scope.traveler = [ { description: \'Senior\', Amount: 50}, { description: \'Senior\', Amount: 50},
From array of objects
function getSum(array, column) let values = array.map((item) => parseInt(item[column]) || 0) return values.reduce((a, b) => a + b) } foo = [ { a: 1, b: "" }, { a: null, b: 2 }, { a: 1, b: 2 }, { a: 1, b: 2 }, ] getSum(foo, a) == 3 getSum(foo, b) == 6