re: Why I prefer objects over switch statements VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION
 

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.

 
code of conduct - report abuse