Is this possible to use a feature similar to this below that will return both properties without having to create a second array. The second property Name will always be the same.
const data = [{
Group: 'A',
Name: 'SEAN'
}, {
Group: 'B',
Name: 'PAUL'
}, {
Group: 'A',
Name: 'SEAN'
}, {
Group: 'B',
Name: 'PAUL'
}];
let unique = [...new Set(data.map(item => item.Group))];
console.log(unique);
return ["A", "B"]
https://codepen.io/vlad-bezden/pen/OMEXJz
I am trying to return
[{
Group: 'A',
Name: 'SEAN'
},
{
Group: 'B',
Name: 'PAUL'
}]