undefinedis a property of a global object, i.e. is a variable in a global area. The initial value undefinedis a primitive value undefined.
In modern browsers (JavaScript 1.8.5 / Firefox 4+) undefined, this is a non-configurable, writable property according to the ECMAScript 5 specification. Even if it is not, avoid overriding it.
, , undefined. undefined, , , . undefined, .
undefined , ( ) , .
var x;
if (x === undefined) {
}
else {
}
typeof
typeof:
var x;
if (typeof x === 'undefined') {
}
typeof , , .
if (typeof x === 'undefined') {
}
if(x === undefined){
}
void
void .
var x;
if (x === void 0) {
}
if (y === void 0) {
}
: MDN - Mozilla