Use the Conditional (Ternary) Operator1

Use the Conditional (Ternary) Operator1
0

#1

Tell us what’s happening:
what is wrong?

Your code so far


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

checkEqual(1, 2);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36 Avast/69.0.792.82.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator/


#2

Hint: Your function is not comparing values a and b.


#3

you mean that it should be a==b right?


#4

what @wawraf said is true.

you need to read more about “JavaScript Comparison and Logical Operators”


#5

I am having the same problem, it won’t let me pass the challenge and my first instinct about the comparison should be == as well. But still not answering the question, how can I move on to the next curriculum? is there any bypass or report of bug in the system?


#6

You don’t must do any challenges, use the menu in the upper right corner Togo anywhere in the curriculum

But, if you want help with your code you would need to post it - if you use the “Ask for help” button most of the work in creating a post and sharing your code will be done automatically