DEV Community

Discussion on: Why I prefer objects over switch statements

Collapse
 
maxart2501 profile image
Massimo Artizzu

Nice.
On the down side, you have to be careful that no more than one condition is verified.
On the plus side, '_' looks like a confused face 😐😀

Anyway, you can do that with objects, too, but booleans would get converted into strings.

Collapse
 
davidchase profile image
David Chase

haha just setup a quick example :)