In TypeScript, I want to compare two variables containing enum values. Here\'s my minimal code example:
enum E { A, B } let e1: E = E.A let e2: E = E.B if (
I would define values for Enum like this and compare with ===
===
const enum AnimalInfo { Tiger = "Tiger", Lion = "Lion" } let tigerStr = "Tiger"; if (tigerStr === AnimalInfo.Tiger) { console.log('true'); } else { console.log('false'); }