See the below objects:
function Manager()
{
this.reports=new Reports();
}
function Reports()
{
//How do I access Manager from here?
}
You can get the function that called a function using:
arguments.callee.caller;
so
function Reports() {
//How do I access Manager from here?
var caller = arguments.callee.caller;
}
does the job in those browsers that support it (Firefox and Safari at
least, I don't think IE does) - but I can't see how that's useful.
It is usually better to explain what you are trying to do at a higher
level, then maybe someone will tell you how to do it, rather than
asking for how to do something explicit that has no obvious rationale.