How to set up JavaScript namespace and classes properly?
Do neither of those things. Make a javascript “class”: var MyClass = function () { var privateVar; //private var privateFn = function(){}; //private this.someProperty = 5; //public this.anotherProperty = false; //public this.someFunction = function () { //public //do something }; }; MyNamespace.MyClass = new MyClass(); One with static vars: var MyClass = (function(){ var static_var; … Read more