-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[js] 第224天 请解释下NaN表示什么呢?typeof NaN结果是什么? #1567
Labels
js
JavaScript
Comments
NaN : not a number. |
|
NaN:: not number, ecma中规定了 NaN 是Number类型。 |
判断一个值是否是NaN等号运算符(== 和 ===) 不能被用来判断一个值是否是 NaN。必须使用 Number.isNaN() 或 isNaN() 函数。在执行自比较之中:NaN,也只有NaN,比较之中不等于它自己。 NaN === NaN; // false
Number.NaN === NaN; // false
isNaN(NaN); // true
isNaN(Number.NaN); // true
function valueIsNaN(v) { return v !== v; }
valueIsNaN(1); // false
valueIsNaN(NaN); // true
valueIsNaN(Number.NaN); // true |
非数字 number |
NaN是“Not-A-Number” (非数值) 的缩写,用于表示本来要返回数值的操作失败了。是一个number类型。typeof NaN结果是‘number’ |
不是一个数字,非Number。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第224天 请解释下NaN表示什么呢?typeof NaN结果是什么?
我也要出题
The text was updated successfully, but these errors were encountered: