I was able to complete the task using .filter() and a For Loop, but not sure why I cannot use the format in my second example. First example works fine.
function destroyer(arr) {
for(i=1; i < arguments.length; i++){
number = arguments[i];
arr = arr.filter(function(num){
return num !== number;
});
}
return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Tried to replace the return num !== number; with return num!==arguments[i] but the arguments[i] does not appear to return the numeric value.
argumentsobject inside the filter callback is for that function, and will be different from theargumentsobject in the surrounding function.