TypeScript enums vs. types for writing readable code
Java enums are a special kind of Java class used to define collections of constants. JavaScript, however, does not have the enum data type, but they are now, fortunately, available in TypeScript since version 2.4. Enums allow us to define or declare a collection of related values that can be numbers or strings as a set of named constants.