Is there a way for an internal object (t1) to access its container object.
var t = {
fnc1: function(){
alert("fnc1");
},
t1: {
fnc2: function(){
alert("fnc2");
},
fnc3: function(){
this.fnc1();
}
}
};
t.t1.fnc3();
when I execute the following code, I get the error message "this.fnc1 is not a function", since this refers to the object t1, and not to the object t.
Is there a way to access fnc1?
source
share