RatecardIDs=[2, 22, 23, 25];
if (parseInt(cellValue) in (RatecardIDs)) {
}
How I can use In operator in if condition. in this code firs time it will execute code in if block then it is executing false block.
In javascript in operator used to get keys in an object. You can use javascript's Array.indexOf or jquery's inArray for that.
Just use like bellow
RatecardIDs=[2, 22, 23, 25];
if(RatecardIDs.indexOf(parseInt(cellValue))>-1){
...
}
Or using jquery
if($.inArray(parseInt(cellValue),RatecardsId)>-1){
....
}
if(RatecardIDs.indexOf(parseInt(cellValue)) > -1)