Currently, I got an array like that:
var uniqueCount = Array();
After a few steps, my array looks like that:
uniqueCount =
Something like this:
uniqueCount = ["a","b","c","d","d","e","a","b","c","f","g","h","h","h","e","a"]; var count = {}; uniqueCount.forEach(function(i) { count[i] = (count[i]||0) + 1;}); console.log(count);
Use a simple for loop instead of forEach if you don't want this to break in older browsers.