| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 9.
function typeOfNaN(x) {
if (Number.isNaN(x)) {
return "Number NaN";
}
if (isNaN(x)) {
return "NaN";
}
}
console.log(typeOfNaN("100F"));
// Expected output: "NaN"
console.log(typeOfNaN(NaN));
// Expected output: "Number NaN"
Number.isNaN(value)
NaN true , false .
Number.isNaN() NaN . JavaScript == === NaN . , NaN false , NaN .
JavaScript x !== x true NaN, Number.isNaN(x) x !== x . .
isNaN() , Number.isNaN() . NaN NaN . NaN Number true .
Number.isNaN(NaN); // true
Number.isNaN(Number.NaN); // true
Number.isNaN(0 / 0); // true
Number.isNaN(37); // false
Number.isNaN() false . false.
Number.isNaN("NaN");
Number.isNaN(undefined);
Number.isNaN({});
Number.isNaN("blabla");
Number.isNaN(true);
Number.isNaN(null);
Number.isNaN("37");
Number.isNaN("37.37");
Number.isNaN("");
Number.isNaN(" ");
isNaN() .
isNaN("NaN"); // true
isNaN(undefined); // true
isNaN({}); // true
isNaN("blabla"); // true
isNaN(true); // false, 1
isNaN(null); // false, 0
isNaN("37"); // false, 37
isNaN("37.37"); // false, 37.37
isNaN(""); // false, 0
isNaN(" "); // false, 0
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-number.isnan |
This page was last modified on 2025 2 11 by MDN contributors.
NumberObject/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |