Enums are a language feature in TypeScript that lets developers define a strict set of options for a variable. Enums default to number enums, so the above enum is essentially an object with 0 , 1 , and 2 as its key. Extending an enum allows you to essentially copy an copy of an existing type.

7m read timeFrom blog.logrocket.com
Post cover image
Table of contents
What are enums in TypeScript?We made a custom demo for . No really. Click here to check it out .Why do we need to extend an enum?Can you extend enums?TypeScript enum best practicesConclusionWriting a lot of TypeScript? Watch the recording of our recent TypeScript meetup to learn about writing more readable code.

Sort: