title: Aggregating object values of JavaScript arrays?
body: <p>In JavaScript, given n number of arrays as input in this format: (n=2)</p>
  
  <pre><code>array1:
  [{x: 1, y: 5},{x: 2, y: 3},{x: 3, y: 6}]
  
  array2:
  [{x: 1, y: 2},{x: 2, y: 6},{x: 3, y: 2}]
  </code></pre>
  
  <p>How do I aggregate the Y-values easily and get this resulting array:</p>
  
  <pre><code>arrayOutput:
  [{x: 1, y: 7},{x: 2, y: 9},{x: 3, y: 8}]
  </code></pre>
  
  <p>Thank you.</p>