O'Reilly logo
  • Jeffrey Damon thinks this is interesting:

Attempting to retrieve values from undefined will throw a TypeError exception. This can be guarded against with the && operator:

flight.equipment                              // undefined
flight.equipment.model                        // throw "TypeError"
flight.equipment && flight.equipment.model    // undefined

From

Cover of JavaScript: The Good Parts

Note

Useful, but hasOwnPrototype probably more expressive