55
rated 0 times
[
60]
[
5]
/ answers: 1 / hits: 37482
/ 12 Years ago, fri, october 5, 2012, 12:00:00
Possible Duplicate:
How to count Matching values in Array of Javascript
I have array with elements as,
array_elements = [2,1,2,2,3,4,3,3,3,5];
i want to count array elements like following manner,
Answer:
2 comes --> 3 times
1 comes --> 1 times
3 comes --> 4 times
4 comes --> 1 times
5 comes --> 1 times
Note : Each value count should print only once.
More From » javascript