我有一個對象myObject的,我想在myObject.b.c.c3功能接入父母成員,如何訪問靜態對象的父成員?
下面是我的例子:
var myObject = {
a: {
a1: 1,
a2: 2
},
b: {
b1: 3,
b2: 4,
c: {
c1: 5,
c2: 6,
c3: function() {
//how can here access a.a1, a.a2, b.b1 and b.b2,??
//not use myObject.a.a1, myObject.a.a2, myObject.b.b1....etc
//can like to use this.parent.parent.a.a1??
}
}
}
}
什麼想法?
http://stackoverflow.com/questions/183702/access-parents-parent-from-javascript-object –