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 (
If was able to compare two enums with this
if (product.ProductType && (product.ProductType.toString() == ProductTypes[ProductTypes.Merchandises])) { // yes this item is of merchandises }
with ProductTypes being this export enum ProductTypes{Merchandises,Goods,...}
export enum ProductTypes{Merchandises,Goods,...}