After looking at Sizzle.js I noticed they have an assert function (see below) which returns !!fn(x)
.
Why would anyone do that? It seems pointless to do that as it would just be "not not"
.
function assert( fn ) {
var div = document.createElement("div");
try {
return !!fn( div );
} catch (e) {
return false;
} finally {
// release memory in IE
div = null;
}
}
Anyone shed any light on this?