I have an array that looks like:
const array = [
{ id: "LAX" },
{ id: "BAS" },
{ id: "TES" },
{ id: "LAX" },
{ id: "LAX" },
{ id: "ATL" },
{ id: "BNA" },
{ id: "LAX" },
];
Here I'm trying to remove duplicate values of id
using Set
[...new Set(array)]
is not currently helping.
I'm basically trying to achieve a result like below:
["LAX", "BAS", "TES"....] // with no duplicates.
Any es6 reasons for this?