I have a simple case of pushing unique values into array. It looks like this:
this.items = []; add(item) { if(this.items.indexOf(item) > -1) {
Using Set
this.items = new Set(); this.items.add(1); this.items.add(2); this.items.add(1); this.items.add(2); console.log(Array.from(this.items)); // [1, 2]