…and a simple answer:
- Property references always evaluate to their value or the
undefined
value if the key does not exist, as long as the base value is not undefined (then a TypeError would be thrown). - Variables throw ReferenceErrors if not defined before, unless they are used with the
typeof
keyword (where they just evaluate to"undefined"
).