为什么是null< 1在JavaScript中是真的吗?

时间:2018-03-22 12:47:17

标签: javascript null

为什么null < 1以及以下几项比较在JavaScript中评估为true

&#13;
&#13;
document.write("null == 1 is " + (null == 1) + "<br />");
document.write("null == 0 is " + (null == 0) + "<br />");
document.write("<hr />");
document.write("null < 1 is " + (null < 1) + " ???<br />");
document.write("null >= 1 is " + (null >= 1) + "<br />");
document.write("<hr />");
document.write("null < 0 is " + (null < 0) + "<br />");
document.write("null >= 0 is " + (null >= 0) + " ???<br />");
document.write("<hr />");
document.write("null > 1 is " + (null > 1) + "<br />");
document.write("null <= 1 is " + (null <= 1) + " ???<br />");
document.write("<hr />");
document.write("null > 0 is " + (null > 0) + "<br />");
document.write("null <= 0 is " + (null <= 0) + " ???<br />");
&#13;
&#13;
&#13;

0 个答案:

没有答案