Tell us what’s happening:
sorry i cant seem to debug this i read the documentation it should work fine but it doesnt…? unsure why
Your code so far
function destroyer(arr) {
// Remove all the values
let test = arr[0];
for (let i=1;i<arr.length; i++)
{
if (test.indexOf(arr[i]))
{
for (let j=0;j<arr[0].length;j++)
{
if(test[j] == arr[i])
{
test.splice(j,1);
}
}
}
}
return test;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy