# Bugged?! - Use the Conditional (Ternary) Operator

**URL:** <https://forum.freecodecamp.org/t/bugged-use-the-conditional-ternary-operator/243760>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [December 4, 2018, 9:01am UTC](https://forum.freecodecamp.org/t/bugged-use-the-conditional-ternary-operator/243760 "2018-12-04T09:01:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViolentRockstar](https://avatars.discourse-cdn.com/v4/letter/v/ea666f/32.png) [@ViolentRockstar](https://forum.freecodecamp.org/u/ViolentRockstar)\
**Post date:** [December 4, 2018, 9:01am UTC](https://forum.freecodecamp.org/t/bugged-use-the-conditional-ternary-operator/243760/1 "2018-12-04T09:01:19Z")

</div>

**Tell us what’s happening:**

Hello everyone!

I’m stuck on this rather simple excercise. No matter what I put in, I always fail the assignment. I even tried copying the official solution, but to no avail.

Is this a bug?

**Your code so far**

```js

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; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36`.

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![RadoIIvanov](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/radoiivanov/32/109245_2.png) [@RadoIIvanov](https://forum.freecodecamp.org/u/RadoIIvanov)\
**Post date:** [December 4, 2018, 9:25am UTC](https://forum.freecodecamp.org/t/bugged-use-the-conditional-ternary-operator/243760/2 "2018-12-04T09:25:26Z")

</div>

You have to check if they are equal, not assign b to a.

---

<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:** [February 2, 2021, 11:24am UTC](https://forum.freecodecamp.org/t/bugged-use-the-conditional-ternary-operator/243760/3 "2021-02-02T11:24:02Z")

</div>

Closed on February 2, 2021, 11:24am UTC


