javascript过滤器数组删除重复项
// Using the Set constructor and the spread syntax:
arrayWithOnlyUniques = [...new Set(arrayWithDuplicates)]
从数组中删除重复项
let chars = ['A', 'B', 'A', 'C', 'B'];
let uniqueChars = [...new Set(chars)];
console.log(uniqueChars);
output:
[ 'A', 'B', 'C' ]