title: Combining JavaScript objects in an array with same key value
body: <p>I have been trying to combine objects inside an array with same id-value. The array that I have is like this:</p>
  
  <pre><code>[
  {"id" : "abcd","val1" : 1,"val2": 1, "val3" : 0},
  {"id" : "abcd","val1" : 1,"val2": 1, "val3" : 1},
  {"id" : "efgh","val1" : 0,"val2": 0, "val3" : 1}
  ]
  </code></pre>
  
  <p>I have been trying to find a way to combine these so that the result would be like this:</p>
  
  <pre><code>[
  {"id" : "abcd","val1" : 2,"val2": 2, "val3" : 1},
  {"id" : "efgh","val1" : 0,"val2": 0, "val3" : 1}
  ]
  </code></pre>
  
  <p>Is there some way to do this with <code>underscore.js</code>?</p>