I'm using an object structure for my js file and want to be able to assign one of the properties (which is an array) to one of the other properties:
AvGen = {
    theBody: {
        bodies: [
            fooObj,
            foo2Obj,   // <--- assign this property...
            foo3Obj
        ],
        bodyColor: '#DB6EDB',
        currBodyNr: 1,
        currBodyObj: AvGen.theBody.bodies[1]    // <--- ...to this property
// ... rest of the code
However, when trying to do it I get the following error message:
Uncaught ReferenceError: AvGen is not defined
If I remove 'AvGen' it says that 'theBody' isn't defined instead. How can I accomplish this?
 
     
     
    