javascript remove duplicates from map code example
Example 1: javascript filter array remove duplicates
// Using the Set constructor and the spread syntax:
arrayWithOnlyUniques = [...new Set(arrayWithDuplicates)]
Example 2: javascript to remove duplicates from an array
uniqueArray = a.filter(function(item, pos) {
return a.indexOf(item) == pos;
})