Assessment wanted for Conditionals #4 skill test

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/

Again, thank you for your time.

V/R,
cazzimoto

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 :wink:

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 :wink: The above line was supposed to hint at using a ternary operator to do this (?). Check out our solution at https://github.com/mdn/learning-area/blob/master/javascript/building-blocks/tasks/conditionals/marking.md#task-4