title: check count of items in Array using jquery
body: <p>I am following this <a href="https://stackoverflow.com/q/5667888">Counting the occurrences / frequency of array elements</a> to find the occurrence
  of each item in the array.
  If any item occurs more than or equal to 3 times, then I have to show an alert.</p>
  <p>Below is the code I have tried:</p>
  <pre><code>var countries = ['India', 'Australia', 'Bangladesh', 'India', 'India',
    'New Zealand', 'New Zealand', 'Pakistan', 'Pakistan', 'West Indies'];
  
  var recipientsArray = countries.sort();
  
  var reportRecipientsDuplicate = [];
  for (var i = 0; i &lt; recipientsArray.length; ++i) {
    if (!reportRecipientsDuplicate[recipientsArray[i]]) {
      reportRecipientsDuplicate[recipientsArray[i]] = 0;
    }
    ++reportRecipientsDuplicate[recipientsArray[i]];
  }
  </code></pre>
  <p>How to check if any item has occurred more than or equal to 3 times? Thanks</p>