This is hard to explain, maybe it's better if I write some sample code:
function A()
{
this.b = new B();
this.a_value = 456;
this.f = function(i)
{
for(var i = 0; i < this.a_value; ++i)
DoStuff(i);
}
this.b.C(this.f)
}
I'm trying to pass a function as an argument to B, but when C tries to reach a_value it's undefined. How do I fix it?
I hope I didn't oversimplify my problem.