Your code:
enum ABC { A = "a", B = "bb", C = "ccc" };
compiled to the following JavaScript ( see demo ):
var ABC; (function (ABC) { ABC["A"] = "a"; ABC["B"] = "bb"; ABC["C"] = "ccc"; })(ABC || (ABC = {}));
This is why you get true for "A" in ABC and false for "bb" in ABC . Instead, you need to search (for example, a loop) for the values โโyourself; A short short liner may be as follows:
Object.keys(ABC).some(key => ABC[key] === "bb")
(or you can Object.values over values โโdirectly using Object.values , if supported)
source share