Cuéntanos qué está pasando:
Hay un error con el test “addTogether(5, undefined) should return undefined
”
Tu código hasta el momento
function addTogether(a, b) {
if(typeof a !== 'number'){
return undefined
}
if(b===undefined) {
return function(c) {
if (typeof c !== 'number'){
return undefined;
}
return a + c;
}
}
if(typeof b !== 'number'){
return undefined
}
console.log(b)
return a + b;
}
// addTogether(2, undefined);
// console.log(addTogether("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))
addTogether(2)
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Challenge: Programación de algoritmos intermedios - Argumentos opcionales
Enlaza al desafío: