title: Group and add values from JSON object
body: <p>I'm having trouble grouping and then adding some values I get from JSON returned from an AJAX query.</p>
  
  <p>The data comes back like this:</p>
  
  <pre><code>0: Object 
    count: 12
    grp: 1
    id: "1"
  1: Object 
    count: 21
    grp: 2
    id: "3"
  2: Object 
    count: 48
    grp: 3
    id: "4"
  3: Object 
    count: 51
    grp: 2
    id: "5"
  </code></pre>
  
  <p>For <code>grp</code> there are five possible options (groups): 1,2,3,4,5. What I want to do is add together all the <code>count</code> values for each specific group. That is, add all <code>grp</code> 1 <code>count</code> values together, all the <code>grp</code> 2 <code>count</code> values together, and so on.</p>
  
  <p>What's the best way to do this? I can't figure out an <code>each</code> or anything that quite works.</p>