title: How to count array elements by each element in javascript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2228362/how-to-count-matching-values-in-array-of-javascript">How to count Matching values in Array of Javascript</a>  </p>
  </blockquote>
  
  
  
  <p>I have array with elements as,</p>
  
  <p>array_elements = ["2","1","2","2","3","4","3","3","3","5"];</p>
  
  <p>i want to count array elements like following manner,</p>
  
  <p>Answer:</p>
  
  <p>2 comes --> 3 times<br/>
   1 comes --> 1 times<br/>
   3 comes --> 4 times<br/>
   4 comes --> 1 times<br/>
   5 comes --> 1 times<br/></p>
  
  <p><strong>Note : Each value count should print only once.</strong> </p>