# Help wanted for Conditionals 4 Test

**URL:** <https://discourse.mozilla.org/t/help-wanted-for-conditionals-4-test/61664>\
**Category:** Learn\
**Created:** [June 9, 2020, 4:03pm UTC](https://discourse.mozilla.org/t/help-wanted-for-conditionals-4-test/61664 "2020-06-09T16:03:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djkamar411](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/djkamar411/32/37974_2.png) [@djkamar411](https://discourse.mozilla.org/u/djkamar411)\
**Post date:** [June 9, 2020, 4:03pm UTC](https://discourse.mozilla.org/t/help-wanted-for-conditionals-4-test/61664/1 "2020-06-09T16:03:44Z")

</div>

Hello @chrisdavidmills. Just wanted to know if my code for the Conditionals 4 test is correct. I have it linked here: [https://codepen.io/thenewcoderfromldn/pen/PoZZYmG](https://codepen.io/thenewcoderfromldn/pen/PoZZYmG)

The link to the assignment is: [https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building\_blocks/Test\_your\_skills:\_Conditionals](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Conditionals)

Thanks so much in advance.

---

<div class="post-metadata">

**Author:** ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)\
**Post date:** [June 10, 2020, 6:41am UTC](https://discourse.mozilla.org/t/help-wanted-for-conditionals-4-test/61664/2 "2020-06-10T06:41:00Z")

</div>

Hey there @djkamar411! You’ll be pleased to know that you have got this VERY nearly right. The only issue was that the ternary operator line was not quite there:

1. The test inside the line needs to use the equality operator, not the assignment operator (this is a really common mistake, so don’t let it worry you).
2. `pwdResult` is already declared, so you don’t need the `let` keyword on the front. In fact, this’ll give you an error, because you can’t redeclare `let` variables.

The updated line looks like this:

```auto
pwdResult = (pwd === 'cheese') ? 'You have successfully logged in.' : 'You have not logged in successfully.';

```

But great work on the whole; you were so close!

---

<div class="post-metadata">

**Author:** ![djkamar411](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/djkamar411/32/37974_2.png) [@djkamar411](https://discourse.mozilla.org/u/djkamar411)\
**Post date:** [June 10, 2020, 12:45pm UTC](https://discourse.mozilla.org/t/help-wanted-for-conditionals-4-test/61664/3 "2020-06-10T12:45:41Z")

</div>

Thanks so much! Will keep the equality operator in mind.

---

<div class="post-metadata">

**Author:** ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)\
**Post date:** [June 10, 2020, 12:51pm UTC](https://discourse.mozilla.org/t/help-wanted-for-conditionals-4-test/61664/4 "2020-06-10T12:51:07Z")

</div>

You are most welcome.
