I'm having an issue getting the structure of my JS code right. I'm basically trying to create a complex object which contains other objects.
What I'm after is basically something like :
object {
f1: (),
f2: (),
objA: {
objA: {
v1: ""
}
},
objB: {
objA: {
v1: "",
v2: "",
f1: ()
}
}
}
Or something similar to this. I had something kinda of working, but in the object, I want to be able to reference other parts of the object.
So for instance, with the example above, I'd like to set the variable object.objA.objB.v1
to be equal to the value from object.objA.objA.v1
When I tried this, I just got an error saying it couldn't access objA
of undefined.
How can I get around this or restructure it to make it work?