How Do Enums Work in TypeScript?

Demystifying and mastering enums in TypeScript

Harsha Vardhan
Better Programming
Published in
3 min readMar 22, 2022

--

Photo by Deon Black on Unsplash

Enums, also known as Enumerations, are constants defined that can be used anywhere in the code. They are relatively straightforward to understand.

How to define Enums?

Enums can be defined in Typescript using the enum keyword. This is how we can define one:

--

--

Engineer, Photographer, Tech Blogger. Builds products and writes for developers. I love to code and love to help others code :)