kendaleiv/jquery-js-refactor — pull request #2 by williambogaiv (2014-01-31 18:08:40+00:00)
Title: Condense if-logic when checking whether top-level variable exists.

New behavior confirms variable creation prior to other functions being called.

Even if you don't want to use the full pull request as-is, you could reduce some of the code by refactoring the if-statements into simple assignments (i.e. var x = x || {}).