Tell us what’s happening:
Output is correct when using console.log(), even in browser… What did I do wrong?
Probably I did not understand the question correctly right?
**Your code so far**
function addTogether() {
let argument1 = arguments[0];
let argument2 = arguments[1];
if (typeof argument1 === 'string' || typeof argument2 === 'string'){
return undefined;
}
else if(Array.isArray(argument1) || Array.isArray(argument2)){
return undefined;
}
if (argument2 === undefined){
const sum1 = function sum1(b) {
console.log(argument1 + b);
}
return sum1;
}
else {
const sum2 = argument1 + argument2;
console.log(sum2);
return sum2;
}
}
addTogether(5)(7);
**Your browser information:**
User Agent is: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
Challenge: Arguments Optional
Link to the challenge: