日期:2014-05-16  浏览次数:20344 次

连个结果都是undefinde,为什么返回false?
var x;
alert(typeof x===x);//false

怎么理解undefined啊?

------解决方案--------------------
http://www.w3school.com.cn/js/pro_js_primitivetypes.asp
------解决方案--------------------
typeof(typeof x) //string

typeof x // undefined

所以.....
------解决方案--------------------
JScript code

var x;
var y=typeof x;//y是一个字符串,值为'undefined'
alert(x===y);
alert(x===undefined);
alert(y==='undefined');

------解决方案--------------------
探讨
JScript code


var x;
var y=typeof x;//y是一个字符串,值为'undefined'
alert(x===y);
alert(x===undefined);
alert(y==='undefined');