DEV Community

Discussion on: Which would you prefer and why?

Collapse
 
sadick profile image
Sadick • Edited

I use a general rule that if the options am supposed to handle exceeds three i use a switch otherwise i use an if statement. Switch was specifically made for such situations.