// x has not been declared before
if (typeof x === 'undefined') { // evaluates to true without errors // these statements execute } //如果未定义变量,那么会出现引用错误 if(x === undefined){ // throws a ReferenceError }
js 中比较 undefined
最新推荐文章于 2022-09-08 17:09:29 发布