Javascript Conditional (Ternary) Operator. Please help

Tell us what’s happening:

Your code so far


function checkEqual(a, b) {
  return a = b ? true:false;
}

checkEqual(1, 2);

I have used

return (a = b ? true : false );

There is information about this if you press, get a hint. I compared code saw tiny differences that shouldn’t affect the outcome, but I still try’ed the code it gave me from it. It didn’t work, am I doing something wrong?
Link to the challenge:
learn.freecodecamp.(this is org i just cant put links yet)/javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator

You are using the assignment operator instead of a comparison operator in your return statement.

1 Like

Thank you! Do you know how I can fix the get a hint?

That is not necessary. It has already been fixed, but the changes have not been moved to production. In fact, the challenge has been changed slightly to return different values than the current production version. You can check out our beta site which has the most updated Guide article for this challenge. We are hoping to have these changes moved to production soon.

The beta challenge is here for comparison sake.

Thank you for your understanding.

Thanks for this answer!