Hi I am doing this challenge and kind of got stumped over a point that why is the below code not working.
function destroyer(arr) {
// Remove all the values
return arr.filter(function(val){return val!=arguments[2];});
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3); //why doesn’t it return 1,2,1,2 ?
I haven’t yet gotten to the point of iterating through the arguments to filter out all the matches from our arr (array). (but thats not my question) I am only asking that as you can see that i am applying filter method on array (arr) and only trying to filter out values using a comparison against the value of arguments[2]. why is it not working? because when i delete this all and just run return arguments[2]; then that returns the correct value so why not working in my code then? Please help someone