title: Count occurence of an array using jquery
body: <pre><code>var status = ['Inprocess', 'Hired', 'Rejected', 'Inprocess'];
  var count = [];
  for (var i = 0; i &lt; status.length ; i++) {
    if(count[status[i]]){
      count[status[i]]++;
    } else {
      count[status[i]] = 1;
    }
  }
  </code></pre>
  
  <p>I have an array status and I am trying to count the occurrence of the status values and getting the result in count array.</p>
  
  <p>I am getting the result as:</p>
  
  <pre><code>count = ["Inprocess" : 2, "Hired" : 1, "Rejected" : 1]
  </code></pre>
  
  <p>Whereas I want the result to be:</p>
  
  <pre><code>count = [2,1,1]
  </code></pre>
  
  <p>Please help.</p>