Cómo presionar solo valores únicos en la matriz en JavaScript
if(this.items.indexOf(item) === -1) {
this.items.push(item);
console.log(this.items);
}
Nice Narwhal
if(this.items.indexOf(item) === -1) {
this.items.push(item);
console.log(this.items);
}
const arr = Array.from({length: 5}, v => Math.floor(Math.random() * 100));
console.log(arr) // Array with random numbers of length 5