Within instances of objects I like to use the closure mechanism to simulate private member variables. For a potential large number of created objects I don't need some of the private members though, but I have to declare them for them to be used in the closure, like "one", "two" and "three" here:
var obj=function()
{
var one;
var two;
var three;
var M=function()
{
one=5;
};
};
(Don't mind that this is not actually a working example of my setup, it's just to demonstrate the use of the closure over the three vars with M.)
Do the var statements themselves already consume memory, or does that depend on actually assigning something to these vars like with "one"?