Tell us what’s happening:
Hello, my code passes all the tests for the Intermediate Algorithm Scripting: Arguments Optional challenge in my IDE but passes none in the free code camp browser (chrome)
Am I using some syntax that free code camp doesn’t like or am I missing something obvious?
Your code so far
function addTogether() {
argsArray = [...arguments]
const isNaNStrict = (num) => {
return !(num === parseInt(num))
}
if (argsArray.some(isNaNStrict)) {
return undefined
}
else if (argsArray.length == 2) {
return argsArray[0] + argsArray[1]
}
else {
return addToArg = (num) => {
if (isNaNStrict(num)) {
return undefined
}
else return argsArray[0] + num
}
}
}
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/81.0.4044.138 Safari/537.36
.
Challenge: Arguments Optional
Link to the challenge: