JSFiddle - React, Tailwind, and code Playground

by Amir Danish

JavaScript

const uniqueCount = [2,2,2,1,4,2,1,1,2,3,5,6,5,4,4];


var counts = {};
uniqueCount.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });

console.log(counts)