Reduce à fond la forme 6

reduce 1
reduce 2
reduce 3
reduce 4
reduce 5

Améliorations


const words = [10,2,2,1,10,10,10,10,10];

const o = words.reduce((a, x) => {
   if (!a[x]) a[x] = 0;
   a[x]=a[x]+1;
return a},{});