Tell us what’s happening:
My solution works for 1,2, & 5, but not 3 & 4. I have no idea why it doesn’t work, any help would be greatly appreciated.
Thanks
Your code so far
function destroyer(arr) {
var args = Array.from(arguments);
for (var i = 0; i < arr.length; i++) {
for (var j = 1; j < args.length; j++) {
if (arr[i] === args[j]) {
arr.splice(i, 1);
}
}
}
return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/seek-and-destroy