Arguments Optional - need help

even though i saw other solutions that were similar to mine and were working, mine keeps throwing an error:
TypeError: addTogether(…) is not a function

would be great if any of you could point out my mistakes

My code

function addTogether() {
  var a = arguments[0];
  var b = arguments[1];
  if(typeof a !== "number" || typeof b !== "number"){
    return undefined;
  }
  
  else if(arguments.length === 2){
    return a + b;
  }
  
  else if (arguments.length === 1 && typeof a == "number"){
    return function(c){
      return a + c;
    };
  }
 
}

addTogether(2)(3);

Link to the challenge:
https://www.freecodecamp.org/challenges/arguments-optional

This is because the addTogether you are calling at the end of the page is not a function. So make it look like this:

var addTogether = function addTogether(){
............

}

It looks like your function has been set without an argument

function addTogether( ARGUMENT SHOULD GO HERE) {

so when you run

addTogether(2)(3);

its trying to add a value to arguments that you have not defined.

I tried setting an argument before but it didnt solve anything

This might help -https://www.youtube.com/watch?v=KhiNrf6RqxQ

If not https://watchandcode.com/ has an excellent section early on that really helps explain it. He uses a sayHiTo for an example and it helped me, after I was stuck on this forever.