Assessment wanted for Conditionals 1 skill test. (Tasks 1-4)

Assessment wanted for Conditionals 1 skill test. (Tasks 1-4)

Link to task: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Conditionals#conditionals_1

Links to my code:
Task-1: https://jsfiddle.net/EiNzp/v1k0mwjf/2/
Task-2: https://jsfiddle.net/EiNzp/ap0d25t3/3/
Task-3: https://jsfiddle.net/EiNzp/gsLk4cfa/2/
Task-4: https://jsfiddle.net/EiNzp/cdwL54re/2/

Thanks :wink:

1 Like

Amazing work, @EiN!
Everything works flawlessly.

As an alternative in task 3 you could also remove the first case and use default at the end of the switch statement:

default: response = 'This is not possible, an error has occurred.';

In task 4 you could make the ternary operator simpler by moving the assignment to the front:

pwdResult = pwd === 'cheese' ? 'Login successful.' : 'Password incorrect; login failed.'

Cheerio,
Michael

1 Like