现在的位置: 首页 > 综合 > 正文

JavaScript的一个有趣测试

2013年09月19日 ⁄ 综合 ⁄ 共 333字 ⁄ 字号 评论关闭

typeof(NaN):number
typeof(Infinity):number
typeof(null):object
typeof(undefined):undefined
NaN == NaN:false
NaN != NaN:true
NaN >= NaN:false
null == undefined:true
null >= undefined:false
null <= undefined:false
parseInt("123abc"):123
"123abc" - 0:NaN
Infinity > 10:true
Infinity > "abc":false
true == 1:true
new String("abc") == "abc":true
new String("abc") === "abc":false

 

抱歉!评论已关闭.