Through some small amount of ingenuity and a bit of outright theft I have been able to cobble together some functions that nearly solve this problem. Unfortunately, I’m also stuck.

I’ve been staring at this code long enough that it’s just turning into a muddy mess in my head.

Any help would be appreciated; I am passing all of the tests except for the second one: “addTogether(2)(3) should return 5”.

Here’s my code:

```
function addTogether() {
//CHECK IF IT BE A NUMBER
function isANum(y){
if (typeof y === "number"){
return true;
}else{
return false;
}
}
//IF THERES 1 ARG TRY TO ADD THE NEXT
if(arguments.length < 2){
if(isANum(arguments[0])){
return function(x){
if (!isANum(x)) {
return undefined;
}else{
return arguments[0] + x;
}
};
}
//IF BOTH ARE NUMBERS, ADD AS NORMAL
}else if(isANum(arguments[0]) && isANum(arguments[1])){
return arguments[0] + arguments[1];
//IF THERES JUST THE ONE ARGUMENT AND IT IS A NUMBER
}else{
return undefined;
}
}
addTogether(2,3);
```

Just to be clear, I’m looking for an explanation of what is missing or how this should work. I know I’m dropping the second number somewhere but, i can’t see it right now.

Thanks in advance.