Seek and Destroy, my code not working

I seem to have done everything right but it won’t pass. i don’t know what i’m missing

  **Your code so far**
function destroyer (arr) {
const valsToRemove = Objects.values(arguments).slice(1);
const filteredArray = [];

for (let i = 0; i < arr.length; i++){
  let removeElement = false;
  for (let j = 0; j < valsToRemove.length; j++){
    if (arr[i] ===valsToRemove[j]){
      removeElement = true;
    }
  }
  if (!removeElement){
    filteredArray.push(arr[i]);
  }
}
return filteredArray
}


destroyer([1, 2, 3, 1, 2, 3], 2, 3);


  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Challenge: Seek and Destroy

Link to the challenge:

minor typo on this line

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.