Hi, I’ve completed this challenge, but it makes me wonder something.
In the line 8 of my code it displays a warning that say “Don’t make functions within a loop”.It literally took me days to realize that this wasn’t something that prevent me for passing this challenge (I never actually tried the code ), I was so frustraiting because I couldn’t get the warning dissapear.
I know it may be stupid for the most experienced ones, but maybe for the new ones (like me) this would help too.
My question is, this “warning” it’s just a suggestion or it’s something to lookout when your coding?
Heré’s my code:
´ ´ ´
function destroyer(arr) {
var args = Array.from(arguments);
for (var i=1;i<args.length;i++){
arr= arr.filter(function(val){
return val != args[i];
});
}
return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Thanks for your answers