I got an email the other day from someone reading through jQuery Fundamentals -- they'd come across the section
about patterns for performance and compression, which is based on a
presentation by Paul Irish gave back at the 2009 jQuery
Conference in Boston.

In that section, there's a bit about alternative patterns for flow control --
that is, deciding what a program should do next. We're all familiar with the
standard if statement:

However, that variable's only purpose would be to provide this one lookup, so
it can be argued that the version that doesn't bother setting the variable is
more economical. Reasonable people can probably disagree about whether this
economy of bytes is a good tradeoff for readability -- something like this is
perfectly readable to a seasoned developer, but potentially puzzling otherwise
-- but it's an interesting example of how we can use literals in JavaScript
without bothering to store a value in a variable.

It's also useful for looking up values generally, which is how I find myself
using it most often these days in my work with Toura, where
we routinely branch our code depending on the form factor of the device we're
targeting:

As an added benefit, constructs that use this pattern will return the
conveniently falsy undefined if you try to look up a value that doesn't have
a corresponding property in the object literal.

A great way to come across techniques like this is to read the source code of
your favorite library (and other libraries too). Unfortunately, once
discovered, these patterns can be difficult to decipher, even if you have
pretty good Google fu. Just in case your neighborhood blogger isn't available,
IRC is alive and well in 2011, and it's an excellent place to get access to
smart folks eager to take the time to explain.