Inside object instances, I like to use a closure mechanism to simulate private member variables. For the potential large number of objects created, I donโt need some of the private members, but I have to declare them to be used in closure, for example โoneโ, โtwoโ and โthreeโ:
var obj=function() { var one; var two; var three; var M=function() { one=5; }; };
(Donโt mind that this is actually not a working example of my installation, just demonstrate the use of closure over three vars with M.)
Do var expressions themselves already make memory, or does it depend on whether something really assigns to these vars as "one"?
Wolfgang stengel
source share