# Guide: Use the Conditional (Ternary) Operator BUG

**URL:** <https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [March 4, 2019, 8:04pm UTC](https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778 "2019-03-04T20:04:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave11132](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@Dave11132](https://forum.freecodecamp.org/u/Dave11132)\
**Post date:** [March 4, 2019, 8:04pm UTC](https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778/1 "2019-03-04T20:04:53Z")

</div>

Hello,  
I discovered a bug in the solution guide of excercise: Basic JavaScript: Use the Conditional (Ternary) Operator. The solution guide can be found here: (unfortunately i can’t post links yet. You can find the guide by clicking: “Get a hint” inside excersice: Basic JavaScript: Use the Conditional (Ternary) Operator.

Solution (wrong):

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

checkEqual(1, 2);

```

Solution (correct):

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

checkEqual(1, 2);

```

Why:  
b should not be assigned to a. b should be checked if its equal to a.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [March 5, 2019, 4:00am UTC](https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778/2 "2019-03-05T04:00:49Z")

</div>

Thanks for helping make FCC better. You can submit updates to the guide through our GitHub.

---

<div class="post-metadata">

**Author:** ![Dave11132](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@Dave11132](https://forum.freecodecamp.org/u/Dave11132)\
**Post date:** [March 5, 2019, 9:09am UTC](https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778/4 "2019-03-05T09:09:01Z")

</div>

I tried to find the dedicated github file but the only file i could find was this one: [https://github.com/freeCodeCamp/freeCodeCamp/blob/master/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator.english.md](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator.english.md) which is the right solution. I don’t think i’m searching at the right place.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [March 5, 2019, 9:35pm UTC](https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778/5 "2019-03-05T21:35:42Z")

</div>

If the guide file on the GitHub already shows the corrected solution, then probably someone has already spotted the error and corrected it. There is a QA process that changes go through before they are released to the live site.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 7:59pm UTC](https://forum.freecodecamp.org/t/guide-use-the-conditional-ternary-operator-bug/262778/6 "2021-01-17T19:59:11Z")

</div>

Closed on January 17, 2021, 7:59pm UTC


