TypeScript
TypeScript EnumsTypeScript Enums
Enums group related constant values together.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
An Enum (short for Enumeration) is a special feature that creates a collection of related, unchangeable values. Developers use them for things that have a specific set of options, like the days of the week, or user permission levels.
Example
Example
Key Points
- Enums can be numeric (0, 1, 2) or string-based ("A", "B", "C").
- String enums are usually easier to debug.
- They prevent spelling mistakes when typing out specific options.
- Unlike interfaces, Enums compile into actual JavaScript code.