Tell us what’s happening:
Everytime I submit the code below, it returns the array found inside of inner_array. Why is this?
Thanks in advance to all who respond!
Your code so far
function destroyer(arr) {
var outer_array = Array.from(arguments);
var inner_array = outer_array.shift();
var new_array = inner_array.filter(function(val){
for (var i = 0; i < outer_array.length; i++) {
if(val != outer_array[i]) {
return val;
}
}
});
return new_array;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/seek-and-destroy