Here is the original problem: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional

My code :

function addTogether(x, y) {

if (typeof y === “undefined”) {

return function (y) {

`return x + y;`

}

}

return x + y;

}

This solves all, but the problems that should return undefined.

I can solve the problems that should return undefined with:

if (!Number.isInteger(y))

`return undefined; return x + y;`

}

I don’t know how to put this all together since only one part seems to work at a time. Is my code wrong altogether? Thanks for taking a look.