私は次のコードを持っています:
var objectParent:{
child1:{
test1:function(){},
test2:function(){}
},
child2:{
demo1:function(){},
demo2:function(){},
parent:this // gives child2
grandparent: .... // need to reference objectParent here
}
}
このキーワードを使用してオブジェクトを参照できますが、グランド オブジェクトまたは親オブジェクトの親とは何ですか?
今、私はgrandparent:objectParentを使用して親オブジェクトを参照しています
このセレクターのように、parentObject を参照する他の方法はありますか?
これらは私のコーディングが悪いですか、良いですか、それともより良いですか?