var arr = [{
id: 1,
name: "a"
}, {
id: 1,
name: "b"
}, {
id: 2,
name: "c"
}, {
id: 2,
name: "d"
}];
implementation result:
arr = [{
id: 1,
name: ["a", "b"]
}, {
id: 2,
name: ["c", "d"]
}];
could you tell me how to achieve this?