Tell us what’s happening:
Hi all, so I need some assistance understanding what this problem is asking. I understand the first half, of creating a function that adds two numbers, if they are both numbers, and if there is only one argument passed, then run a function. Where I get lost is when they say the returned function will be expecting a second number to add to the original number. If you run ‘addTogether(2);’ how is the function going to expect a second number, if there is only one passed in? I don’t understand what they are asking.
Your code so far
function addTogether(value1, value2) {
if (typeof value1 === 'number' && typeof value2 === 'number'){
return value1 + value2;
} else {
}
}
console.log(addTogether(2));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional