Tell us what’s happening:
Describe your issue in detail here.
Everything works perfectly not until I added this line to my code
if(typeof(arguments[0])!== “number” || typeof(arguments[1])!== “number”){
return undefined;
}
**Your code so far**
function addTogether(x, y) {
if(typeof(arguments[0])!== "number" || typeof(arguments[1])!== "number"){
return undefined;
}else {
if(arguments.length === 1){
return function(y){
return x + y;
};
}else {
return x + y;
}
}
}
var sumTwoAnd = addTogether(2);
console.log(sumTwoAnd(2));
console.log(addTogether(2, 5));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36
Challenge: Arguments Optional
Link to the challenge: