How to get names of enum entries in Typescript?

Posted by Jessica Taylor | Updated on

Want to get names of enum entries in Typescript? The code you posted will work; it will print out all the members of the enum, including the values of the enum members. For example, the following code:

It Will print the following output:

If you instead want only the member names, and not the values, you could do something like this:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers