Sto tentando di cambiare un mio programma da Python a Javascript e mi chiedevo se esistesse una funzione JS come la funzione Counter dal modulo collections in Python.Esiste una funzione Javascript simile alla funzione Contatore Python?
sintassi per Counter
from collection import Counter
list = ['a', 'b', 'c', 'b', 'a', 'b', 'c', 'a', 'a', 'a']
counter = Counter(list)
print counter
uscita
Counter({'a':5, 'b':3, 'c':2})
Vedi http://stackoverflow.com/a/12873271/2055998 –