title: Javascript to group and sum 2 arrays by matching value
body: <p>I'm using Javascript and I have two arrays which I need to combine into one and pass the resulting array to <code>Highcharts</code>, but the arrays need to be grouped and summated for each matching value in the <code>symbolArray</code>.</p>
  <pre><code>Input Arrays
  var symbolArray = [&quot;GSK&quot;, &quot;VOD&quot;, &quot;VOD&quot;, &quot;GSK&quot;, &quot;VOD&quot;];
  var valueArray = [100, 220, 120, 230, 155];
  
  // Group symbolArray by each unique value (VOD, GSK) and
  // summate the values in valueArray matching each unique value.
  
  Output Arrays
  var GroupBysymbolArray = [&quot;GSK&quot;, &quot;VOD&quot;];
  var GroupByvalueArray = [330, 495];
  
  HighchartsArray = [GSK, VOD, 330, 495]
  </code></pre>
  <p>I can setup an jsfiddle if required.</p>