new set to remove duplicates code example
Example 1: js delete duplicates from array
const names = ['John', 'Paul', 'George', 'Ringo', 'John'];
let unique = [...new Set(names)];
console.log(unique); // 'John', 'Paul', 'George', 'Ringo'
Example 2: remove duplicate array es6
let a = [10,20,30,10,30];
let b = [... new Set(a)];
console.log(b);