4 ms·
In case anybody was wondering for a second when JS got so awesome -- it didn't, this is a snippet of Python. D'oh. Sigh.
by recuter 13y ago
In case anybody was wondering for a second when JS got so awesome -- it didn't, this is a snippet of Python. D'oh. Sigh.
- 1wheel 13y agoJS isn't that bad if w/ underscore or d3: d3.entries((s.split(" ").reduce(function(p, v){ v in p ? p[v]++ : p[v] = 1; return p;}, {}))) .sort(function(a, b){ return a.value > b.value; }) .map(function(d){ return d.key;}) .slice(-10);