Seek and Destroy Challenge not accepting correct output.
Challenge Seek and Destroy has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function destroyer(arr) {
// Remove all the values
function comp (element, index, array){
return element !== this;
}
var result = arr;
var arg = arguments;
for(var i = 1; i<arg.length; i++){
console.log(i);
result = result.filter(comp, arg[i]);
}
return result;
}
destroyer(["tree", "hamburger", 53], "tree", 53);
im returning ["hamburger"] as requested in the last checkpoint but it's not being recognized? What am I missing?
I'm not exactly sure why the console is returning ["hamburger"], but if you type in console.log(this) in your comp() function, you'll notice that it logs either a String object or a Number object. One of those JavaScript quirks of assigning a value to this I guess. You'll have to convert those objects to their primitive values.
Please check out the Help Chat first if you're stuck on a challenge.
Sorry, but Issues are not for code problems. As @alistermada say, please ask for help in Help Chat.
Thanks and Happy Coding!