Hi, so here's the problem....
I create an object with new
How do I reference the constructors object, which is the question marks?Code:new Owner(); function Owner() { new Pet(); } function pet() { this.parent = ???????? }
![]()
Hi, so here's the problem....
I create an object with new
How do I reference the constructors object, which is the question marks?Code:new Owner(); function Owner() { new Pet(); } function pet() { this.parent = ???????? }
![]()
Just pass the parent object as an argument
Using arguments when parent is already specified may cause some problems. Two variables are defined, obj.parent, and arguments[0]. They may overlap.
pet.parent I think. I'm not sure if functions are meant to be objects in this case.How do I reference the constructors object, which is the question marks?
If you did:
In this case, t is the object and parent is one of it's nodes.Code:var t = new pet(); alert(t.parent)
- Mike
Bookmarks