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?

Thanks for this answer!