Answers for "find duplicates and their count in an array javascript"

1

find duplicates and their count in an array javascript

var counts = {};
your_array.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });
Posted by: Guest on May-12-2020

Code answers related to "find duplicates and their count in an array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language