Assessment wanted for Conditionals skill tests

hi, could you please assess my code for conditional skill tests?

marhaba @bedribulut

you doing great well done here my notice :

  1. for task 3 you could remove the first 2 cases when it <0 or >100 and put the response in the default case
    so the default become
    default: response = 'This is not possible, an error has occurred.'

  2. for ternary statment you can rewrite it as
    pwdResult = (pwd === 'cheese') ? 'login is successful.' : 'may you please try again?';

hope that help and have a nice day :slight_smile:

2 Likes

I just updated the code regarding your feedback.
I really do appreciate for your contribution.
have a nice day too.

1 Like

@bedribulut you very welcome

looks like you did not saved the change in task 3

just to make it clear why i change the default case cause if you calculate all cases yo would see it already cover all cases so for the case of < 0 and > 100 it could be fine to be set in the default case

default help when there could be other cases but you did not cover them or you can not predict it like if you compare a string value then you could not predict all the possibility of that string value

and for task 4 well done
and just to make it clear that the ternary statement return the value before : and the one after it unless if you call method there that does not return any value

and thanks a lot and keep the good work :smile:

2 Likes

just updated again. thank you so much.

1 Like

well done and you very welcome :slight_smile:

1 Like