get key of enum typescript typescript enum get key by value

The solution for “get key of enum typescript typescript enum get key by value” can be found here. The following code will assist you in solving the problem.

let enums = Object.keys(SomeEnum).filter(x => x === yourValue));enum Status{
Active = ‘Active’,
Inactive = ‘Inactive’
}

let status = STATUS.Active

console.log(status)
output: “Active”

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in