I wanted to use string enums in typescript but I can\'t see a support for reversed mapping in it. I have an enum like this:
enum Mode { Silent = \"Silent
None of the answers really worked for me, so I have to fall back to normal for the loop. my enum is
enum SOME_CONST{ STRING1='value1', STRING2 ='value2', .....and so on } getKeyFromValue =(value:string)=> Object.entries(SOME_CONST).filter((item)=>item[1]===value)[0][0];