function addTogether() {
  if (arguments.length > 1) {
    let result = 0;
    for (let index in arguments) {
      if (typeof arguments[index] != "number") {
        return;
      } else {
        result += arguments[index];
      }
    }
    return result;
  }
  if (typeof arguments[0] == "number") {
    let result = arguments[0];
    return (value) => {
      if (typeof value == "number") {
        return result += value;
      }
    };
  }
}

console.log(addTogether(5)(7));

addTogether(2, 3) should return 5.

addTogether(23, 30) should return 53.

addTogether(5)(7) should return 12.

addTogether("https://www.youtube.com/watch?v=dQw4w9WgXcQ") should return undefined.

addTogether(2, "3") should return undefined.

addTogether(2)([3]) should return undefined.