title: Sum similar keys in an array of objects
body: <p>I have an array of objects like the following:</p>
  
  <pre><code>[
      {
          'name': 'P1',
          'value': 150
      },
      {
          'name': 'P1',
          'value': 150
      },
      {
          'name': 'P2',
          'value': 200
      },
      {
          'name': 'P3',
          'value': 450
      }
  ]
  </code></pre>
  
  <p>I need to add up all the values for objects with the same name. (Probably also other mathematical operations like calculate average.) For the example above the result would be:</p>
  
  <pre><code>[
      {
          'name': 'P1',
          'value': 300
      },
      {
          'name': 'P2',
          'value': 200
      },
      {
          'name': 'P3',
          'value': 450
      }
  ]
  </code></pre>