Currently, I got an array like that:
var uniqueCount = Array();
After a few steps, my array looks like that:
uniqueCount =
Simple is better, one variable, one function :)
const counts = arr.reduce((acc, value) => ({ ...acc, [value]: (acc[value] || 0) + 1 }), {});