Is there a way to group an array of objects by referring to certain value of the object in the array
let say I do have an array called
a=[
{name: "abc", address: "xxx"}
{name: "def", address: "yyy"}
{name: "xyz", address: "xyz"}
{name: "abc", address1: "123"}
{name: "def", address1: "456"}
]
I need to add the address of same name into one object and the new Array should look like as below
b =[
{name:"abc", address: "xxx", address1: "123"}
{name:"def", address: "yyy", address1: "456"}
{name: "xyz", address: "xyz"}
]