After reading a good book I found for myself a mthod to have private
members in Class
Here is the pattern
var myClass = Class.create((function(){
var
_private_prop1,
_private_prop2,
public_prop;
function _privateFunc1(){ ... }
function _privateFunc2(){ ... }
function
One thing is stay for me unconvinient is calling private functions in
public functions.
It's nessety to call them with .bind(this)(...)
function publicFunc1(){
...
_private_prop1 = 45;
_privateFunc1.bind(this)();
...
}
May be you have suggestion on this
--
You received this message because