Languages
[Edit]
EN

TypeScript - convert enum to string

12 points
Created by:
Selina-Miranda
737

In TypeScript it is possible to get enum name in following way.

1. Getting enum name by value from compiled in data example

Edit

Output:

2. Getting enum name by value with custom logic example

Edit

Example:

Output:

3. References

Edit
  1.  Reverse mappings - 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