javascript filter array Usuń duplikaty
// Using the Set constructor and the spread syntax:
arrayWithOnlyUniques = [...new Set(arrayWithDuplicates)]
Usuń duplikaty w tablicy
uniq = [...new Set(array)];
or
uniqueArray = a.filter(function(item, pos) {
return a.indexOf(item) == pos;
})