可能重複:
Comparing NaN values for equality in Javascript我如何測試NaN?
誰能告訴我這是爲什麼不工作?
if(inbperr == NaN){
document.getElementById('inbclo').value = "N/A";
}
else{
document.getElementById('inbclo').value = "%" + inbperr;
}
而不是返回百分比值或「N/A」像我這想它的精選返回「%NAN」。
只是一個替換語法是DRY-ER ...'的document.getElementById( 'inbclo')值= isNaN(inbperr) 'N/A':? 「%」 + inbperr;' – Basic 2012-07-06 00:37:42
http://stackoverflow.com/questions/2652319/how-do-you-check-that-a-number-is-nan-in-javascript – Foreever 2014-07-14 04:20:36
'函數isReallyNaN的(a){ \t \t返回isNaN的可能的複製(a)&&「number」== typeof a \t};' – SpYk3HH 2015-01-19 20:51:25