could you help me get the desired output from a list using javascript?
let list = [
{ id: 1, name: "a" },
{ id: 1, name: "ab" },
{ id: 1, name: "abc" },
{ id: 2, name: "x" },
{ id: 2, name: "xy" },
{ id: 2, name: "xyz" },
{ id: 2, name: "xyze" },
]
the output I want :
let list2 = [
{ id: 1, name: "abc" },
{ id: 2, name: "xyze" },
]