I am faced with an array that has the following structure:
const array = [
{ id: "LAX" },
{ id: "BAS" },
{ id: "TES" },
{ id: "LAX" },
{ id: "LAX" },
{ id: "ATL" },
{ id: "BNA" },
{ id: "LAX" },
];
I have been attempting to eliminate duplicate values of id
using Set
[...new Set(array)]
This method is not proving to be effective at the moment.
My goal is essentially to achieve a final outcome resembling the following:
["LAX", "BAS", "TES"....] // without any duplicates.
Do you know of any ES6 solutions for this issue?