hi, could you please assess my code for conditional skill tests?
marhaba @bedribulut
you doing great well done here my notice :
-
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.'
-
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
I just updated the code regarding your feedback.
I really do appreciate for your contribution.
have a nice day too.
@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
just updated again. thank you so much.
well done and you very welcome