js to remove repeating string array of strings code example
Example 1: use set to remove duplicates in javascript
const names = ['John', 'Paul', 'George', 'Ringo', 'John'];
let unique = [...new Set(names)];
console.log(unique); // 'John', 'Paul', 'George', 'Ringo'
Example 2: deduplicate array javascript
function uniq(a) {
return Array.from(new Set(a));
}