Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
thecodingaviator on master
remove A (#31157) (compare)
:cookie: 377 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
@pablovvb on the same problem. finding it trickier than I thought.
function destroyer(arr) {
var args = arr.slice.call(arguments);
for (var i = 1; i < args.length; i++)
var seek = args[i];
var destroyed = args[0].filter(function(val){
return val !== seek;
});
return destroyed;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Any advice would be helpful.
args[0]
. What does destroyed return?
[[1, 2, 3, 1, 2, 3] , 2 , 3]
[1, 2, 3, 1, 2, 3]
arr
Hi all,
I am working on the "Arguments Optional" challenge. I have tested all 5 cases. The returned results are exactly what FreeCodeCamp wants, however, when click submit, only the top two cases are marked as correct. The last 3, which expects "undefined" to be returned, are marked incorrect. When testing for all 3 undefined cases in FCC's editor window, the returned result is "undefined" (It shows on the left hand column).
Does anyone know why FCC won't recognize the returned values of "undefined"?
:cookie: 378 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
:star2: 3440 | @moigithub |http://www.freecodecamp.com/moigithub
:cookie: 379 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel