Assessment wanted for Conditionals 1, Conditionals 2, Conditionals 3 and Conditionals 4 skill tests
Congratulations @church_craig!
Your code is correct. I still have two remarks:
- Task 3: In the switch condition I would rather use the value
true
instead of a variable that happens to be true there. - Task 4: You could move
pwdResult =
to the front in order to not write it twice:
This works because the ternary operator has higher precedence (priority) than the assignment and it evaluates to one or the other string.pwdResult = pwd === 'cheese' ? 'Login successful.' : 'Password incorrect; login failed.'
See you,
Michael