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.

Again, thank you for your time.


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