June 10, 2008
Show Love to the Object Literal:
Object literals beauty lies in Namespaces, which reduces the number of global variables in your pages. It uses a technique known as branching, which allows you to use common utility
functions without worrying about browser sniffing.
Using global variables in your page presents a huge risk, and a namespace created with a singleton is one of the best ways to remove those global variables. I stuck many times using global variables and also consume good amount of memory.