1
我有幾個文本框,其中返回javascript Number
值,如果有效的數據是在文本框中,否則NaN
。我得到這種奇怪的行爲。當我在firebug
檢查(這兩個文本框爲空白):Javascript variable /'NaN'behaviourirdirdly
>>> hours
NaN
>>> minutes
NaN
>>> minutes == NaN
false
>>> hours == NaN
false
>>> hours == minutes
false
爲什麼表現如此?
謝謝'isNaN'就做好了:) – 0xc0de 2012-04-10 08:23:28