Passionate about building great technology and connecting with people to create positive change. Happy to answer questions about transitioning to tech. Find me on Twitter @lounecl
Adding to this, MDN's article linked from The Odin Project says that one of the cases switch should be used over if...else blocks is when you have to deal with many choices.
Thank you for the article! I didn't understand why logical operators doesn't work for switch.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I decided to use it here to get more practice with switch statements, but in this scenario, if/else would be more appropriate
this article explores when to use if/else vs a switch statement
Adding to this, MDN's article linked from The Odin Project says that one of the cases
switch
should be used overif...else
blocks is when you have to deal with many choices.Thank you for the article! I didn't understand why logical operators doesn't work for
switch
.