Tell us what’s happening:
On the last test, where the second argument is an array with a number, I’m not able to verify that the second argument exists at all, let alone work with it in order to pass the test.
I am logging the second argument to the console and, for that last test, the console says “undefined” as if there is no second argument at all. Is this a bug?
Ignore all of the code everything except:
console.log(arguments[1]);.
This isn’t a complete attempt. I am specifically just asking why the second argument can’t be accessed in the test where the second argument is ([3]).
Your code so far
function addTogether() {
let nanz = function(x) {return isNaN(x);}
let arr=Array.from(arguments);
console.log(arr,arguments[1]);
if (arr.some(nanz)) {return undefined;}
}
addTogether(2,3);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional