es6 using filter to remove duplicates code example
Example 1: remove duplicate array es6
let a = [10,20,30,10,30];
let b = a.filter((item,index) => a.indexOf(item) === index);
console.log(b);
Example 2: remove duplicate array es6
let a = [10,20,30,10,30];
let b = [... new Set(a)];
console.log(b);