I have a javascript array which get created dynamically in this format.
[{prdName: "Testing2"},
{prdName: "Testing2,Testing3"},
{markets: "Testing5"},
{markets: "Testing5,Testing6"}]
I want to remove the duplicate key in the above array map and convert it into this format.
[ {prdName: "Testing2,Testing3"},
{markets: "Testing5,Testing6"} ]
Could you let me know how to achieve the same. I am working on a reactjs application.
[{a:"Test1"}, {a:"Test2"}]the result must be[{a:"Test1,Test2"}]or it's enough to just get the latest ocurrence of "a" (resulting in[{a:"Test2"}])?