export enum MESSAGE_TYPE { INFO = 1, SUCCESS = 2, WARNING = 3, ERROR = 4, }; var type = 3; if (type in MESSAGE_TYPE) { }