I've found that undefined object property not equals to undefined
.
if (obj.unexistingProperty === undefined) {
// condition is false
}
if (typeof obj.unexistingProperty === 'undefined') {
// condition is true
}
While debugger consoles (Firebug and Chrome dev tools) consider both conditions true.
What is the explanation for that?
As it turned out, the code took place inside of
function (undefined) {
...
}
that shadowed undefined
in local scope.