remove duplicate elements using filter methid javascript code example
Example 1: javascript filter array remove duplicates
// Using the Set constructor and the spread syntax:
arrayWithOnlyUniques = [...new Set(arrayWithDuplicates)]
Example 2: remove duplicates array.filter
// removeDuplicates ES6
const uniqueArray = oldArray.filter((item, index, self) => self.indexOf(item) === index);