Removing all matching values from array

Hi,

I’m working on problem ’ Intermediate Algorithm Scripting: Seek and Destroy’. I can’t post links yet: learn . freecodecamp . org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy

Is there an easy way for the argument values to be all removed from the array?

My code:

function destroyer(arr, b, c) {
  for (var i = 1; i < arguments.length; i++) {
    if (arr.indexOf(arguments[i]) > -1) {
      arr.splice(arr.indexOf(arguments[i]), 1);
    }
  }
  console.log(arr);
  //return arr;
}

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

Gives me [1, 1, 2, 3], but I want [1, 1].

.filter() is good start

Thanks! Will give it another shot using filter().

Solved it. Thanks a lot for the help.

function destroyer(arr) {
  for (var i = 1; i < arguments.length; i++) {
    var arr = arr.filter(numbers => numbers != arguments[i]);
  }
 return arr;
}

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