Here is a simple illustration:
//Saul was born: Initialize the parent!
var parent = {
youngestChild: 'Small Saul'
};
//Tim was born: Overwrite the parent!
parent = {
youngestChild: 'Tiny Tim',
currentYoungestChild: parent.youngestChild
};
alert(parent.currentYoungestChild);
Who is parent.currentYoungestChild?
Like many developers, I thought parent.youngestChild would be set to 'Tiny Tim' before it would be set to parent.child. If that were the case, it would be set to 'Tiny Tim'.
However, it turns out that all children are evaluated prior to being stored on their parent, so
parent.currentYoungestChild == 'Small Saul'
Here's a fiddle if you want to try it out.
One explanation for this functionality is because then order of child declarations do not matter. For example, the following would have had a different outcome if objects were evaluated and stored sequentially:
parent = {
currentYoungestChild: parent.youngestChild,
youngestChild: 'Tiny Tim'
};
Long story short: Initializing child elements from other child elements in an object declaration will not work!