How to call private and public functions in a namespace

I have a namespace that has few private and public functions. How can I call them from another public function (in the same namespace)?

var myns = (function () { var module = {}; function private_F1() { } function private_F2() { } // public module.public_doSomething = function () { }; module.Init= function () { // Why cant i call functions inside the same namespace using "this" this.private_F1(); //does not work with "this" keyword private_F1(); //worked without "this" keyword this.public_doSomething() //does not work with "this" keyword public_doSomething //does not work without "this" keyword myns.public_doSomething() //worked with namespace }; return module; })(); 
+4
source share

All Articles