title: Combining objects in an array with same key (date)
body: <p>I have an array of objects and I want to combine the objects that have the same date values so I have an array like. I am looping through them with .map(i => ) and chekcing on the previous index but i'm getting the wrong values.</p>
  
  <pre><code> [{ id: '8',
     name: 'hfh',
     consumed_date: '2017-03-14',
     calories: 8952 },
   { id: '7',
     name: 'onion',
     consumed_date: '2017-03-14',
     calories: 224},
   { id: '6',
     name: 'onion',
     consumed_date: '2017-03-14',
     calories: 279},
   { id: '2',
     name: 'Ready-to-Serve Chocolate Drink',
     consumed_date: '2017-01-01',
     calories: 3036} ]
  </code></pre>
  
  <p>And i want to end up with an array like</p>
  
  <pre><code>[{date: 2017-03-14,
  calories: 9455},
  date: 2017-01-01,
  calories: 3036}]
  </code></pre>