How to find sum of duplicate values in an array using javascript
<p>I have the following array with me. And my aim is to create a new array by removing duplicate values from this array. </p>

<pre><code>var xDataValuesdash =  [    [ 'Anantapur', 10, '#C21466' ],
                            [ 'Anantapur', 20, '#A983D0' ],
                            [ 'Chittoor', 30, '#A993D0' ],
                            [ 'Anantapur', 30, '#544DDF' ],
                            [ 'Anantapur', 4, '#A994D0' ],
                            [ 'Chittoor', 40, '#544BDF' ]  ];
</code></pre>

<p>ie, The resultant array must be </p>

<pre><code>var new_xDataValuesdash = [[ 'Anantapur', 64, '#C21466' ], 
                           [ 'Chittoor', 70, '#544BDF' ]];
</code></pre>

<p>While removing duplicates its value must be added to the unqiue value.</p>