I think I made a decent code concerning the Seek and Destroy challenge. One part I do not understand.
When I change arguments[i] in the if statement to 1,2 or 3 here,or any other integer,which presents the “destroyer number”, the code seems to work. But my arguments[i] wont work. When I set it arguments[1] or arguments[2] or something like that,it also doesnt work. What seems to be the problem?
function destroyer(arr) {
var filtered = arguments[0].filter(function(val) {
for (var i = 1; i < arguments.length; i++) {
if (val !== arguments[i]) {return true;}
return false;
}
});
return filtered;
}