Javascript literal object and singleton pattern
1 answer
I found the answer in the article:
http://addyosmani.com/resources/essentialjsdesignpatterns/book/#singletonpatternjavascript
Singlets differ from static classes (or objects) in that we can delay their initialization, usually because they require some information that may not be available during initialization. They don't provide a way for code that doesn't know the previous link to them to get them easily. This is because it is neither an object nor a "class" returned by a Singleton, it is a structure. Think of how closed variables are not actually closed - the function scope that provides closure is closure.
+1
source to share