If I declare an object as follows:
var foo.bar = new Object;
Does that automatically make foo an object? If not and I want both foo and foo.bar to be objects do I need to use the following code:
var foo = new Object;
var foo.bar = new Object;
And if I create these two objects as above, is there a parent/child relationship between them or are they completely separate entities?
I apologize for the simple nature of my question, but I am trying to more fully understand the various ways data can be structured.
No. It’s a syntax error;
No, that’s again a syntax error. You should be using.
But it’s more common to use object literal syntax these days;
They are completely separate entities. The only link between them is that
fooholds a reference tobar. Something else can easily hold a reference to bar;Try it yourself… http://jsfiddle.net/AMXLE/1