title: Returning sum of duplicate elements in javascript array
body: <p>I've checked the forum to see if i'll have an answer to this question but so far, i haven't. I have this 2 dimensional array that i want to sum up their values if they are the same. Here is an example.</p>
  
  <pre><code> CAR      CAH     394
   CAR      CAH     96
   CAR      CAP     268
   DOR      CAF     71
   DOR      CAP     96
   DOR      CAP     268
   VAC      GILAB   71
  </code></pre>
  
  <p>After sorting the array, i have the above values. How can i add up all the duplicates in the arraylist. In this case, it will affect CAR|CAH and DOR|CAP. So instead of returning the duplicates, its goint to return one with the combined sum.</p>