if( navigator.userAgent.toLowerCase().indexOf('firefox') > 0 ){
$('#GICCriteriaRate span.rateSelect').each(function (i, ob) {
$(ob).switchClass( 'rateSelect', 'rateSelectMoz' );
});
}else if( navigator.userAgent.toUpperCase().indexOf('MSIE') > 0 ||
!!navigator.userAgent.match(/Trident.*rv[ :]*11\./) ||
!!navigator.userAgent.match(/Trident.*rv[ :]*12\./)){
$('#GICCriteriaRate span.rateSelect').each(function (i, ob) {
$(ob).switchClass( 'rateSelect', 'rateSelectIE' );
});
}
The !! construct is a simple way of converting any JS expression into its Boolean equivalent, just the logical NOT operator, twice. For example: !!"ANGULAR JS" === true and !!0 === false. Here we end up converting a function(string's match()) into its Boolean equivalent.
!! simulates the behavior of the Boolean() casting function. The end result is the same as using the Boolean() function on a value.
No comments:
Post a Comment