Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

counting duplicate values javascript

var counts = {};
your_array.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #counting #duplicate #values #javascript
ADD COMMENT
Topic
Name
1+3 =