Tell us what’s happening:
I’m trying to delete the numbers in the array that equals to the numbers out of the array.
Your code so far
function destroyer(arr) {
let args = [].slice.call(arguments);
for(let i = 0; i < args.length; i++) {
for(let j = 0; j < args[i].length; j++) {
if(args[i][j] === args[i]) {
delete args[i][j];
}
}
return args[0];
}
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy