I\'m calculating taxes for a very complicate invoicing approach. I can\'t explain the whole process but if you have questions I will answer as best as I can
When you're looping over the objects, see what taxId it is and generate a sum for each different taxId.
var sums = {}, obj, i;
for (i = 0; i < selected_taxes.length; i++){
obj = selected_taxes[i];
if (!sums[obj.tax_id]) {
sums[obj.tax_id] = 0;
}
sums[obj.tax_id] += +obj.tax_value;
}
console.log(sums); //{ 1:26.46, 2:34.39, 3: 52.76}
http://jsfiddle.net/4X6Wb/