Say I have array like this:
[ \"foo\", \"bar\", \"foo\" \"bar\", \"bar\", \"bar\", \"zoom\" ]
I want to group it so I
Yeah I guess with Array.prototype.reduce, it's just:
const map = list.reduce((a, b) => { a[b] = a[b] || 0; return ++a[b], a; }, {});
wondering if there is less verbose way tho.