Languages
[Edit]
EN

TypeScript - enum type

5 points
Created by:
Bess
571

In TypeScript it is possible to create enum type in following ways.

1. Automatic numeric enum members example

Edit

Output:

2. Computed and constant enum members example

Edit

Output:

3. Assigned numeric enum members example - auto counting

Edit

Output:

4. String enum members example

Edit

Output:

5. Generating logic enum members example

Edit

Output:

6. Heterogeneous enum members example - strings + numbers

Edit

Output:

7. References

Edit
  1. Enums - Microsoft Docs
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

TypeScript

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join