Menu
Does JS methods have the same scope chain JS functions have?
If they have the same scope chain, then
codes:
function Ob()
{
var v=”from ob”;
this.f=function (){
alert(v);
}
}
var oo= new Ob();
after this codes are executed, call object of Ob is not garbage, since the obejct is still in the scope chain of oo.f. Is this correct?
And:
function Ob()
{
var v=”from ob”;
}
var oo= new Ob();
After this code are executed, call object becomes garbage, since there is no reference to the call object. Is this correct?