首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

这个undefined要如何理解

2012-05-12 
这个undefined要怎么理解?JScript codevar aalert(typeof typeof a)a的值为undefinedtypeof a返回undefi

这个undefined要怎么理解?

JScript code
var a;alert(typeof typeof a);

a的值为undefined

typeof a返回undefined (也就是说typeof undefined返回undefined)

但是再次typeof这个undefined结果就变成了string了~

[解决办法]
undefined 相当于java 的NULL
[解决办法]
参考:http://www.cnblogs.com/qiantuwuliang/archive/2010/01/12/1645302.html
[解决办法]
参考:ECMAScript 原始类型,对Undefined类型讲得非常透彻。
[解决办法]
var a;
alert(typeof typeof a);

typeof a 输出的是 'undefined',再 typeof 'undefined' 就是 string
[解决办法]
探讨

var a;
alert(typeof typeof a);

typeof a 输出的是 'undefined',再 typeof 'undefined' 就是 string

[解决办法]
探讨

var a;
alert(typeof typeof a);

typeof a 输出的是 'undefined',再 typeof 'undefined' 就是 string

[解决办法]
探讨
var a;
alert(typeof typeof a);

typeof a 输出的是 'undefined',再 typeof 'undefined' 就是 string

[解决办法]
探讨
引用:
var a;
alert(typeof typeof a);

typeof a 输出的是 'undefined',再 typeof 'undefined' 就是 string

++

热点排行