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)
Trying to read the value of an undeclared variable (which you have to do before you can compare that value to the value of undefined) throws a ReferenceError.
Applying the typeof operator to an undeclared variable does not.