Possible Duplicate:
What is the !! (not not) operator in JavaScript?
I’ve seen operator ! used like !!. For example
var filter = !!(document.body.filters);
If I’m not wrong it’s equivalent var filters = typeof document.body.filters != 'undefined'?
Is it a good practice to use !!?
It’s a common way to convert any return type to boolean (usually to avoid compilation warnings).
And second: no, checking if type is “undefined” is mandatory anyway and “!!” can not cover it.