Singleton_1


/* Singleton as an Object Literal. */
MyNamespace.Singleton = {};

You will now use a function, executed immediately, to provide the same thing:

/* Singleton with Private Members, step 1. */
MyNamespace.Singleton = function() {
    return {};
}();


Comments

Popular posts from this blog

Project euler 169 found clue

Floyd-Warshall's algorithm