consider the following sample JS Object
const samplejson = [
{id:'1',value: "AC",},
{id:'2',value: "AB",},
{id:'3',value: "AC",},
{id:'4',value: "AA",},
{id:'5',value: "AA",},
{id:'6',value: "AA",},
{id:'7',value: "AB",},
{id:'8',value: "AC",},
{id:'9',value: "AA",},
{id:'10',value: "AA",},
]
I want to filter the JS object based on the values unique count and descending order like the following
based on the value counts AA - 5, AB - 2 and AC - 3, but I need the output as AA,AC
In react or JS how can achieve this?