【发布时间】:2016-10-05 08:42:33
【问题描述】:
请参考这里的jsfiddle,https://jsfiddle.net/reuk08ob/
html:
<div id="abc"></div>
脚本:
if(null==false){
document.getElementById("abc").innerHTML="hello, null == true coerced";
}else if(Boolean(null)==false ){
document.getElementById("abc").innerHTML="hello, boolean constructor coercion worked! previous one did not,strange, both should do the same, shouldn't they?";
}
我错过了什么吗?布尔构造函数不应该与 if 语句中隐式执行的类型强制相同吗?
【问题讨论】: