title: JavaScript - get count of object with specific value
body: <p>I have referred these questions listed below, but didn't helped me out.</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/5667888/counting-the-occurrences-frequency-of-array-elements">Counting the occurrences / frequency of array elements</a></li>
  <li><a href="https://stackoverflow.com/questions/16468124/count-values-of-the-inner-two-dimensional-array-javascript">Count values of the inner two-dimensional array - javascript</a></li>
  <li><a href="https://stackoverflow.com/questions/6829346/count-elements-in-a-multidimensional-array?rq=1">Count elements in a multidimensional array</a></li>
  </ol>
  
  <p>I want to get count from object with specific value. For example, I have this array list,</p>
  
  <pre><code>var testData = [
    {
      "issue_type": "Warning",
      "created_date": "2019-05-13T13:43:16.437Z",
    },
    {
      "issue_type": "Warning",
      "created_date": "2019-05-13T13:45:16.330Z",
    },
    {
      "issue_type": "Alert",
      "created_date": "2019-05-13T13:43:16.437Z",
    },
    {
      "issue_type": "Alert",
      "created_date": "2019-05-13T13:45:16.330Z",
    }
  ]
  </code></pre>
  
  <p>I want to count how many objects with key <code>"issue_type"="Warning"</code> are there.</p>
  
  <p>I tried with this loop but it is not what I'm looking for,</p>
  
  <pre><code>var counts = {};
  for (var i = 0; i &lt; arr.length; i++) {
      var num = arr[i];
      counts[num] = counts[num] ? counts[num] + 1 : 1;
  }
  console.log(count['issue_type']);
  </code></pre>
  
  <p>Please suggest me the way out.</p>