My program returns the correct results but does not pass one item on the checklist
What is the problem in my code?
function addTogether(x, y, z) {
let args = [...arguments];
if (args.every(num => typeof num === "number")) {
return x && y ? x + y : x && !y ? z => z + x : undefined;
}
}
let sumTwoAnd = addTogether(2);
console.log(addTogether(2, [3]));
console.log(sumTwoAnd(3));
console.log(addTogether(2)(3));
// running tests
addTogether(2)([3])
should return undefined.
// tests completed
// console output
undefined
5
5