use filter methid to renove duplicate elements in array code example
Example: remove duplicates array.filter
// removeDuplicates ES6
const uniqueArray = oldArray.filter((item, index, self) => self.indexOf(item) === index);
// removeDuplicates ES6
const uniqueArray = oldArray.filter((item, index, self) => self.indexOf(item) === index);