Finden Sie Duplikate und ihre Zählung in einem Array JavaScript
var counts = {};
your_array.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });
Xanthous Xenomorph
var counts = {};
your_array.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });