DEV Community

Discussion on: Using the Switch Statement with Logical Operators

Collapse
 
jasterix profile image
Jasterix • Edited

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

Collapse
 
porobertdev profile image
Robert P.

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.