In the Google JavaScript style guide, it says not to use wrapper objects for primitive types. It says it's "dangerous" to do so. To prove its point, it uses the example:
var x = new Boolean(false);
if (x) {
alert('hi'); // Shows 'hi'.
}
OK, I give up. Why is the if code being executed here?
Boolean(false) === !(new Boolean(false))
. AndBoolean(false) === new Boolean(false).valueOf()
. – Juanajuanita