Skip to content
Advertisement

TypeScript enum to specific object

I have the following TypeScript enum:

JavaScript

If I import it in my react application and console.log it, I will get the following object returned:

JavaScript

How can I manipulate it, so that I get the following object returned?

JavaScript

I tried it with const Lang = Object.keys(SupportedLanguages) and also with .map() but I did not get the expected object returned.

Advertisement

Answer

Are you just looking to get a new object with all the data as empty strings?

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement