Change:
--- title: Use the Conditional (Ternary) Operator --- <ins> ![:triangular_flag_on_post:](https://forum.freecodecamp.com/images/emoji/emoji_one/triangular_flag_on_post.png?v=3 ":triangular_flag_on_post:") Remember to use <a>**`Read-Search-Ask`**</a> if you get stuck. Try to pair program ![:busts_in_silhouette:](https://forum.freecodecamp.com/images/emoji/emoji_one/busts_in_silhouette.png?v=3 ":busts_in_silhouette:") and write your own code ![:pencil:](https://forum.freecodecamp.com/images/emoji/emoji_one/pencil.png?v=3 ":pencil:") </ins> ## Use the Conditional (Ternary) Operator <del> ### Problem explanation: _Use the `conditional operator` in the `checkEqual` function to check if two numbers are equal or not. The function should return either true or false._ </del> <ins> ### ![:checkered_flag:](https://forum.freecodecamp.com/images/emoji/emoji_one/checkered_flag.png?v=3 ":checkered_flag:") Problem Explanation: * You need to write a function named `checkEqual`, which checks if the two parameters are equal. * If the parameters are equal, `true` is to be returned else `false` should be returned. ## ![:speech_balloon:](https://forum.freecodecamp.com/images/emoji/emoji_one/speech_balloon.png?v=3 ":speech_balloon:") Hint Use ternary operator to check for equality. </ins> <del> #### Hint 1 Remember that the "traditional" `if...else` syntax can be re-written using the conditional operator (`condition ? statement if true : statement if false;`) </del> > _try to solve the problem now_ <del> > </del> <ins> ## Spoiler Alert! </ins> <del> ## Spoiler alert! </del> <ins> ![warning sign](//discourse-user-assets.s3.amazonaws.com/original/2X/2/2d6c412a50797771301e7ceabd554cef4edcd74d.gif) </ins> **Solution ahead!** <del> ## Code solution: </del> ```javascript function checkEqual(a, b) { return a === b ? true : false; } ``` <del> ·  Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Ternary-operator). ### Code explanation - The function checks if the `condition` before the interrogation sign (`?`) is true, and if so, executes the `true` statement. Otherwise, it returns `false`. ### Resources - ["Conditional (ternary) operator" - *MDN JavaScript reference*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) </del> <ins> ### Code Explanation: * A function `checkEqual` is declared, it accepts two parameters in variables `a` and `b`. * The `return` statement would return the value of the evaluated ternary expression. * The ternary expression checks if `a` and `b` are equal or not and returns `true` or `false` respectively. </ins>

Discussion:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: In a hint for conditional operator shown an invalid solution. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 70.0.3538.102 (64-bit) Operating System: Windows 10 Home for one language, 64-bit If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): ! There is an assignment operator instead of the equality operator
This was fixed in PR it would soon be pushed to production. I'm fixing the formatting of the file.
As stated above, this has been resolved, but until the changes have been pushed to production, it will still show. Due to it being fixed, I am closing this issue. Thank you.
Hi, Sorry to get back to you on this topic but it seems that the invalid solution is still showing up : [] I am still having an assignment operator instead of the equality one - which works fine. Thank you.
the changes have not been pushed to production yet. The changes will appear once the repository is pushed to production
Ok, thanks.