Possible Duplicate:
What is the !! (not not) operator in JavaScript?
Reference - What does this symbol mean in JavaScript?
I find the js code write like this : !!undefined , !!false;
the jquery source code (jQuery 1.7.0.js: Line 748):
grep: function( elems, callback, inv ) {
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ){
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
}