Typescript Enumeration

JS
S
JavaScript

Enums allow us to define a set of named constants. Using enums can make it easier to document intent, or create a set of distinct cases. TypeScript provides both numeric and string-based enums.

1enum Direction {
2    Up,
3    Down,
4    Left,
5    Right,
6}

Created on 7/24/2019