« 玄大 | 首页 | 裸奔的牛氓 »
个人主页: http://wkliang.blogspot.com
在 Javascript的10个设计缺陷 留言:
各种语言多少都有一些怪癖的。 例如,Pascal 不能用 = 对两个实数比值;纯粹从数学的观点,这是合理的,但也造成很多程序员的困扰吧?! new Number("not_number") // 传回 NaN new Number("not_number") === NaN // 传回 false isNaN(new Number("not_number") // 传回 true 基本上,NaN 还是 number, 与其说超过极限,不如说赋值有问题的 number 吧!?
2011-07-27 15:51:44
在 如何判断Javascript对象是否存在 留言:
第八种写法 根据javascript的语言设计,undefined == null AIK, 这样子的说法是有问题的! undefined 与 null 各属于不同的 primitive data type. The difference with undefined is that if a variable has a value null, it is still defined, it only happens that its value is nothing.
2011-07-27 15:10:52
留言(2 条)
在 Javascript的10个设计缺陷 留言:
各种语言多少都有一些怪癖的。
例如,Pascal 不能用 = 对两个实数比值;纯粹从数学的观点,这是合理的,但也造成很多程序员的困扰吧?!
new Number("not_number") // 传回 NaN
new Number("not_number") === NaN // 传回 false
isNaN(new Number("not_number") // 传回 true
基本上,NaN 还是 number, 与其说超过极限,不如说赋值有问题的 number 吧!?
2011-07-27 15:51:44
在 如何判断Javascript对象是否存在 留言:
第八种写法 根据javascript的语言设计,undefined == null
AIK, 这样子的说法是有问题的! undefined 与 null 各属于不同的 primitive data type.
The difference with undefined is that if a variable has a value null, it is still defined, it only happens that its value is nothing.
2011-07-27 15:10:52