DEV Community

Discussion on: What goes to default section of your code?

Collapse
 
emptyother profile image
emptyother

I usually prefer placing an exception there. In typescript i often add a assertUnreachable() method there that returns never. If an enum value goes unhandled, the compiler will give an error.