var data= [{tharea: "Rare Disease", value: 3405220},
{tharea: "Rare Disease", value: 1108620},
{tharea: "Rare Disease", value: 9964980},
{tharea: "Rare Disease", value: 3881360},
{tharea: "Rare Disease", value: 4090880},
{tharea: "Rare Disease", value: 1657600}];
The desired output for the object would be:
data=[{tharea:"Rare Disease",value:[3405220,1108620,9964980,3881360,4090880,1657600]}]
I attempted to use flatmap but did not achieve the expected result