DEV Community

Discussion on: A Case Against Switches

Collapse
 
miguelpinero profile image
Miguel Piñero • Edited

Maybe you can do something like this:

return choices[x] || choices.default
Collapse
 
aodev profile image
AoDev

This would not work. I have explained why above.