Thank you. I get it. I had returned the function value instead of the function. (I actually admit I looked up the solution for this one at the end after passing all tests except 1-2 because I was not understanding what the question was saying when it said create a function which expects an argument etc which I did but I was not sure how exactly to passed the test so I took a quick look at the function implementation.
Last one part of this(the function implementation) and the prime numbers one were the only ones I looked though. Rest I did by myself. I did look up and studied all the solutions one by one after I passed the test which is what took a lot of time, effort and pain.
Looking and traversing through the given solutions is much harder and painful than actually creating your own solution as in the solution they complicate small things so much like even something as basic as create a array from 1 to 5.
Some of the provided solutions are definitely a bit convoluted. Mine doesn’t look like any of them:
function addTogether(a, b = null) {
if (b === null && typeof a === "number") {
return c => typeof c === "number" ? a + c : undefined;
}
if ((typeof a !== "number") || (typeof b !== "number")) {
return undefined;
}
return a + b;
}
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.