Missing a test of Arguments Optional

Tell us what’s happening:
Describe your issue in detail here.
Hello , could anyone tell me what’s wrong with my code , i miss the following test ( addTogether("https://www.youtube.com/watch?v=dQw4w9WgXcQ") should return undefined .)
thank you in advance.

   **Your code so far**
function addTogether() {
 let arg=Array.from(arguments)
 if(arg.length==1){
   return x=>addTogether(arg[0],x)
 }
if(arg.some(element=>typeof element!=='number')){
  return undefined
}
return arg[0]+arg[1]
}

addTogether(2,3);
   **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

Challenge: Arguments Optional

Link to the challenge:

that will be a recursion, because you are calling the same function inside itself, but you are not supposed to do it, you have to return a new function

you have to check for invalid numbers here too

Or you can change the order of the if statements.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.