7 lines
198 B
TypeScript
7 lines
198 B
TypeScript
|
enum MyEnumType {
|
||
|
foo, bar
|
||
|
}
|
||
|
var _arr = [{ key: 'foo' }, { key: 'bar' }]
|
||
|
var enumValue = MyEnumType.foo;
|
||
|
var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type
|