Blogger Information
Blog 82
fans 0
comment 1
visits 108327
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
js里一些实在想不通的问题合集
子龙的博客搬家啦httpswwwcnblogscomZiLongZiLong
Original
846 people have browsed it

The global NaN property is a value representing Not-A-Number.

--MDN

NaN 是用来表示一个非数字的值得全局属性,

但是typeof之后的运算结果 却是 number。

虽说undefined和null都有空值的含义,然而 isNaN( 1 + undefined)是true,

isNaN( 1 + null) 是false。


对象都是真值,嗯,没错,==运算符会做类型转换,嗯,没错,然而,神奇的事情还是发生了:(看过我前面博客文章的朋友应该可以解释这个现象)

var bolean = new Boolean(false);
if(bolean) console.log(1);//打印1
bolean == true //false


  接下来这个不知道能不能纳为神奇现象:

typeof( Function.prototype ) == 'function' //true
Function.prototype.__proto__ == Object.prototype //true;

总是觉得Function.prototype.__proto__指向Function.prototype才完美啊,哈哈不过这样的话就会报错啦,Function就成单体动物了 也不符合js所有对象都派生自Object的说法!

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post