Tell us what’s happening:
Describe your issue in detail here.
I can not understand how number 7 gets passed into the addSecond() function?
**Your code so far**
function addTogether() {
const [first, second] = arguments;
// First argument is not a number
if (typeof(first) !== "number") {
return undefined;
}
// First argument is a number
// and second argument is not defined
else if (second === undefined) {
function addSecond(second) {
// New argument is not a number
if (typeof(second) !== "number") {
return undefined;
}
// New argument is a number
else {
return first + second;
}
}
// Note: returning a *function*
return addSecond;
}
// First argument is a number
// and second argument is not a number
else if (typeof(second) !== "number") {
return undefined;
}
// First argument is a number
// and second argument is a number
else {
return first + second;
}
}
console.log(addTogether(5)(7));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Challenge: Arguments Optional
Link to the challenge: