The strict equality operator === will return false since the Boolean object and the Boolean literal are not strictly equal. In fact, even this will return false, because the two newly created objects are not the same object:
new Boolean(true) === new Boolean(true)
However, the deletemode == false test will return true because it will call the .valueOf() method and get false , which therefore is correctly compared to false .
The alert() function always calls .toString() in its parameter, therefore it also displays false instead of the standard [Object object] .
source share