# Assessment wanted for Conditionals #4 skill test

**URL:** <https://discourse.mozilla.org/t/assessment-wanted-for-conditionals-4-skill-test/53634>\
**Category:** MDN\
**Tags:** learning\
**Created:** [February 10, 2020, 4:26am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-conditionals-4-skill-test/53634 "2020-02-10T04:26:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cazzimoto](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cazzimoto](https://discourse.mozilla.org/u/cazzimoto)\
**Post date:** [February 10, 2020, 4:26am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-conditionals-4-skill-test/53634/1 "2020-02-10T04:26:28Z")

</div>

Sir @chrisdavidmills,

When you have a moment I have submitted my solution for Conditionals skills test problem #4. My solution works. I am curious if you have feedback.

[https://jsfiddle.net/cazzimoto/opb9r8um/2/](https://jsfiddle.net/cazzimoto/opb9r8um/2/)

Again, thank you for your time.

V/R,  
cazzimoto

---

<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:** [February 10, 2020, 9:25am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-conditionals-4-skill-test/53634/2 "2020-02-10T09:25:48Z")

</div>

Hi @cazzimoto! This works as expected, so well done! I do feel a little bit funny having the `switch` statement before the `machineResult` assignment, as surely it should check the machine is on first and deliver the result of that, before then checking the password. But given the way browsers handle conditionals, it works anyway 😉

A minor nitpick is that in the instructions, it says " We’d like you to do this in a single line, using something that isn’t an `if ... else` structure."

A switch statement isn’t a single line 😉 The above line was supposed to hint at using a ternary operator to do this (`?`). Check out our solution at [learning-area/javascript/building-blocks/tasks/conditionals/marking.md at main · mdn/learning-area · GitHub](https://github.com/mdn/learning-area/blob/master/javascript/building-blocks/tasks/conditionals/marking.md#task-4)
