182
rated 0 times
[
189]
[
7]
/ answers: 1 / hits: 17942
/ 11 Years ago, sat, february 23, 2013, 12:00:00
I have following code:
var objectParent:{
child1:{
test1:function(){},
test2:function(){}
},
child2:{
demo1:function(){},
demo2:function(){},
parent:this // gives child2
grandparent: .... // need to reference objectParent here
}
}
We can reference object by using this keyword, But what for grand object or i mean parent of parent object?
Now, i am using grandparent:objectParent to reference parent object
Is there other way like this selector to reference parentObject?
Are these my coding is bad,good or better?
More From » javascript