title: count occurrences of two keys in objects in array
body: <p>I have the following array with objects and used the following code to creating a tally with the key "id":</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var arr=[
  { id: 123, 
    title: "name1",
    status: "FAILED"
  },
  {
   id: 123,
   title: "name1", 
   status: "PASSED"
  },
  {
   id: 123,
   title: "name1",
   status: "PASSED"
  },
  {
   id: 123,
   title: "name1",
   status: "PASSED"
  },
  {
   id: 1234,
   title: "name2",
   status: "FAILED"
  },
  {
   id: 1234,
   title: "name2",
   status: "PASSED"
  }
  
  ];
  
  
  const test =arr.reduce((tally, item) =&gt; {
      
       if (!tally[item.id]) {
      tally[item.id] = 1;
       } else {
      tally[item.id] = tally[item.id] + 1;
       }
       return tally;
     }, {});
        
  console.log(test);</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now what I want to do is to modify the tally to take in consideration the key status as well so the result will be somthing like:</p>
  
  <pre><code>[
  {id:123, status:"PASSED", tally:3},
  {id:123, status:"FAILED", tally:1},
  {id:1234, status:"PASSED", tally:1},
  {id:1234, status:"FAILED", tally:1}
  ]
  </code></pre>
  
  <p>Any idea? Thanks!</p>