Tell us what’s happening:
Describe your issue in detail here.
Hello!
My “Seek and Destroy” challenge solution passed all the tests but was different from the solutions in the explanations.
Looking for some feedback on the solution I came to. Is it just as good? Any awkward/wonky code?
For instance, one of the other solutions builds the “items to remove” array using
Object.values(arguments).slice(1);
I like this better than what I came up with.
**Your code so far**
function destroyer(arr) {
let newArr = arguments[0];
let darr = [];
for (let i=1; i < arguments.length; i++ ) {
darr.push(arguments[i])
};
let finalArr = newArr.filter( num => !darr.includes(num))
return finalArr;
}
destroyer(["tree", "hamburger", 53], "tree", 53)
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
// if element x is in newArr, remove it from newArr
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Seek and Destroy
Link to the challenge: