JSFiddle - React, Tailwind, and code Playground
by MuLtDirectX
JavaScript
let arr = [12, 10, 8, 12, 7, 6, 4, 10, 12]
let obj = arr.reduce((obj, el) => {
obj[el] ? obj[el]++ : obj[el]=1
return obj
}, {})
let brr = Array(Object.keys(obj).length).fill(null).map((e,i) => {return {obj}})
console.log(brr)