If I have an undeclared variable and use typeof it tells me it\'s undefined. But if I then check it using if (qweasdasd === undefined)
typeof
undefined
if (qweasdasd === undefined)
You have an undefined variable, but not an undefined object value.
console.log(variable) // undefined console.log(typeof variable) // "undefined" console.log(variable === undefined) // Reference error variable = undefined ; console.log(variable === undefined) // true