Referencing “private methods” in a closure

Paphprath

New Member
\[code\]var Foo = (function () { var foo = function() { }; var privateMethod = function(){ }; foo.prototype = { init: function() { console.log(this.privateMethod); //undefined } }; return foo;})();\[/code\]I know that I can access \[code\]privateMethod\[/code\] directly without using the \[code\]this\[/code\] pointer. But since I come from the c# world, I would like to use it for readability purposes. Is there any way to reference my "private methods" using a pointer?
 
Back
Top