Alternatives to enums in TypeScript

added by JavaScript Kicks
2/26/2020 8:13:27 AM

870 Views

A recent blog post explored how TypeScript enums work. In this blog post, we take a look at alternatives to enums. Table of contents: An alternative to creating an enum that maps keys to values, is to create a union of singleton types (one per value). Read on to see how that works.


0 comments