解法1:
let uniqueArray = [...new Set([5,5,2,2,2,4,2])];
或
let uniqueArray = [...new Set(dupeArray)];
解法2:
let dupeArray = [3,2,3,3,5,2];
let uniqueArray = Array.from(new Set(dupeArray));
解法3:
if(this.items.indexOf(item) === -1) {
this.items.push(item);
console.log(this.items);
}