I have structured my JavaScript file using objects and I am trying to assign one property (which is an array) to another property:
AvGen = {
theBody: {
bodies: [
fooObj,
foo2Obj, // <--- need to move this property...
foo3Obj
],
bodyColor: '#DB6EDB',
currBodyNr: 1,
currBodyObj: AvGen.theBody.bodies[1] // <--- ...to this property
// ... rest of the code
However, I keep getting an error message that says:
Uncaught ReferenceError: AvGen is not defined
If I remove 'AvGen' then it complains that 'theBody' is not defined. What should I do to make this work?