One particular enum is causing some confusion:
export enum myEnum {
name1 = 'my name',
name2 = 'my other name',
name3 = 'other'
}
An object of myEnum has been created:
const x = myEnum.name1;
console.log(x) // prints 'my name'
Is there a way to output 'name1' using the variable x? Essentially, how can the enum name 'name1' be retrieved using a myEnum value like 'myEnum.name1'?
UPDATE:
Here is a visual representation: