Tell us what’s happening:
const destroyer = (arr, ...valsToRemove) => arr.filter(elem => !valuesToRemove.includes(elem));
should be
const destroyer = (arr, ...valuesToRemove) => arr.filter(elem => !valuesToRemove.includes(elem));
Your code so far
function destroyer(arr) {
let myArray = Array.from(arguments).slice(1);
return arr.filter(item => myArray.indexOf(item) == -1)
}
console.log(destroyer([1, 2, 3, 1, 2, 3], 2, 3));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 OPR/66.0.3515.44
.
Challenge: Seek and Destroy
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy