I’ve spent quite a bit of time on the challenges, Seek and Destroy and Falsy Bouncer.
It felt like there was huge jump in knowledge required compared with previous challenges, which had a good Freecode tone to them.
Trying to work out the solutions using the documentation is very difficult, and I was unable to do it. The Boolean and Arguments objects have various ways of being used and I would never have thought to use them in the way the solutions present.
Can anyone explain to a noob in plain language what these objects do and what their most common usage is?
Because even though I kind of understand the solution now, when I go back to read the documentation I find it is a bit abstract.
Your code so far
function destroyer(arr) {
var allArgs = Array.prototype.slice.call(arguments);
for (i = 0; i < arr.length; i++){
for(j = 0; j < allArgs.length; j++){
if (arr[i] === allArgs[j]) {
delete arr[i];
}
}
}
return arr.filter(Boolean);
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/seek-and-destroy