I like the idea of using Singleton mentioned here http://www.adobe.com/devnet/html5/articles/javascript-design-patterns-pt1-singleton-composite-facade.html:
var Namespace = {
Util: {
util_method1: function() {…},
util_method2: function() {…}
},
Ajax: {
ajax_method: function() {…}
},
some_method: function() {…}
};
Let’s say I have to add some methods and new namespace too (Namespace.Util2) later, how can I add methods without modifying the above code
It is simply:
To add a new namespace,