Arguments optional bug

Arguments optional bug
0

#1

I think I’ve found a bug in Arguments Optional Java script challenge. It’s the last one in intermediate.

I’ve run the code for the last test case in repl.it, in my sublime editor, and on google chrome console, and they all return undefined as they should.

For some reason FreeCodeCamp returns 32.

function addTogether() {
var args = Array.from(arguments);

if(Array.isArray(args[0])){
return undefined;
}

if(Array.isArray(args[1])){
return undefined;
}

if(args.every(function(item){return typeof item === ‘number’;})){

if(args.length === 1){
return function(num){
return num + args[0];
};
}
return args[0] + args[1];
}

return undefined;

}

addTogether(2)([3]);