标签:
// x has not been declared before
if (typeof x === ‘undefined‘) { // evaluates to true without errors
// these statements execute
}
//如果未定义变量,那么会出现引用错误
if(x === undefined){ // throws a ReferenceError
}
标签:
原文地址:http://www.cnblogs.com/micro-chen/p/5871250.html