The reason the solution doesn’t work is that it is erroneous for a different, common reason. The syntax of the return statement isn’t the problem. It’s that they are using the assignment operator,
=, instead of the equality operator
==. Fix that, and you’ll see that it passes.
FYI, the assignment operator both assigns the value of the expression on the right to the variable on the left AND returns the value of the expression on the right, so in the return statement, as long as
0 (a falsy value), the condition will always be
true, so the
checkEqual always returns
b == 0, which isn’t what we want.
So, congratulations on finding an error! Time to contribute, and gain the honor and esteem of your fellow coders! Open up an issue at the github: https://github.com/freeCodeCamp/freeCodeCamp/issues