function destroyer(arr) {
// Remove all the values
var destroyed = [];
for (var i = 1; i < arguments.length; i++) {
destroyed = arguments[0].filter(function(item) {
return (item !== arguments[i]);
});
}
return destroyed;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I don’t really get what’s going on even after running through the debugger. Could anyone please tell me what’s wrong with this code?