Seek and Destroy alt solution?

Seek and Destroy alt solution?
0

#1

So I have been going back and looking at the previous algorithm challenges to be able to do the more advanced challenges. Could someone tell me why this code isn’t working?

function destroyer(arr) {
  // Remove all the values

  return arguments[0].filter(function (x){
              for (var i=1;i<arguments.length;i++) {
                if (x !== arguments[i]) {
                return x;
                }
              }      
                    });  

}

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

#2
if (x !== arguments[i]) {
   return x;
}

What happens when x == 1 and arguments[i] === 2?


#3

Every function has its own arguments object.*

*except arrow (=>) functions

#4

I get it now. Thanks for clearing that up.