Seek and Destroy. confused by the argument

Tell us what’s happening:
Hi, the console here says that arr is 1,2,3,1,2,3. I thought it should be the 1, 2, 3, 1, 2, 3, 2, 3. Can someone tell me what have I misunderstood?

Your code so far


function destroyer(arr) {
  console.log(arr)
  return arr.filter(x => arr[0].includes(x) && !arr.includes(x));
}

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36.

Link to the challenge:

ah I get it now, arguments is different from array. Thanks for clicking in guys.

The instructions are saying to use the arguments object. If you console.log(arguments) you’ll see the object containing all the info/data (arguments) being sent to the function.

1 Like