Hi, I’m posting my conditionals practice exercises for revision. I think number 3 is not working properly.
Links
Ex 1
https://codepen.io/jcito14/pen/rNxgapr
Ex 2
https://codepen.io/jcito14/pen/PoZvwQz
Ex 3
https://codepen.io/jcito14/pen/xxZNbJe
Ex 4
https://codepen.io/jcito14/pen/MWKdYMP
Thanks in advance.
Juan
Hi @Juan_Salerno!
I’ve tested all your code, and the first two work great - well done
For task 3, switch statements are a pain to write. In this case, we’d recommend the switch(true)
pattern. Have a look at our answer, which also includes a link to an explanation: https://github.com/mdn/learning-area/blob/master/javascript/building-blocks/tasks/conditionals/marking.md#task-3
The code in task 4 works, but I’d recommend putting the ternary operator line inside the if() {}
part of the statement — it doesn’t make sense to be able to log in when the machine is off.
Apart from that, great work!