Lefu Posted December 22, 2007 Share Posted December 22, 2007 hi all I need to know how do I compare the following enumeration values with a string to get either of numbers. What am I doing wrong? var eFilterType = { No:0, Yes:1 }; var i = 'No'; if (eFilterType == i) alert('success'); Thanx a lox Link to comment https://forums.phpfreaks.com/topic/82833-solved-function-enum/ Share on other sites More sharing options...
Lefu Posted December 22, 2007 Author Share Posted December 22, 2007 I have solve my problem this way. for(var j in eFilterType) { if (i == j) alert('Alert the world'); } Then I was able to continue with my bad intentions. have a good time programming Link to comment https://forums.phpfreaks.com/topic/82833-solved-function-enum/#findComment-421301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.