function destroyer(arr) {
let arr2= Array.from(arguments).slice(1);
let arr3=[];
for (let i=0; i < arr; i++) {
for (let j=0; j < arr2; j++) {
if (arr[i] !== arr2[j]) {
arr3.push(arr[i]);
}
}
}
return arr3;
}
I would double check your logic. Every single time arr[i] is not equal to one of the elements of arr2 you add it to the arr3? Have you seen how much stuff you’re putting into arr3?
This says to add arr[i] to the array arr3 every single time it doesn’t match one of the elements in arr2. I think you want instead to add arr[i] to arr3 only if it doesn’t match every single element in arr2.