Is there a way, without explicitly calling the parent object by its instance name, to refer to the parent object's members? In the below example, the statement this.me
refers to the me
member of child
. I know I can do something like var who = obj.me
, but I was curious if there was a more implicit method of going about this?
var obj = {
me: 'obj',
child: {
me: 'child',
init: function() {
var p = document.getElementById('console');
var who = this.me;
p.innerHTML = who;
}
}
};
obj.child.init();