TypeScript tip: Use “never” to assure every case in a switch is handled
TypeScript tip: Use “never” to assure every case in a switch is handled.
With this example, if a case is missing, TypeScript fails to compile. 👍
#typescript

Also, you can technically omit the default and it will still work, but I find using a default on the switch is more intuitive.
Here's the difference in two separate images.

