So I have been going back and looking at the previous algorithm challenges to be able to do the more advanced challenges. Could someone tell me why this code isn’t working?
function destroyer(arr) {
// Remove all the values
return arguments[0].filter(function (x){
for (var i=1;i<arguments.length;i++) {
if (x !== arguments[i]) {
return x;
}
}
});
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);