JavaScript怪癖和秘密之数值0和false实例页面
代码:
HTML代码:
<button id="button">弹出 0 == false</button>
JS代码:
document.getElementById("button").onclick = function() { var someVar = 0; alert(someVar == false); };
<button id="button">弹出 0 == false</button>
document.getElementById("button").onclick = function() { var someVar = 0; alert(someVar == false); };