Object within object add property with JavaScript
<p>I have an object within an object. It looks like this.</p>

<pre><code> var myLib = {
     object1: {}
 }
</code></pre>

<p>My basic problem is that I wanted to end up like this. So I would like to do this dynamically I will not know the property's or additional objects until run time.</p>

<pre><code>var myLib = {
    object1: ({"A1":({"Color":"Blue",
                      "height":50})
    })
}
</code></pre>

<p>From reading here on Stack&nbsp;Overflow I know that I can create an object within an object by simply going like this:</p>

<pre><code>  myLib.Object1["A1"] = "Something"
</code></pre>

<p>But this does not produce what I'm looking for.</p>

<p>I tried this syntax which I know is wrong but basically</p>

<pre><code> mylib.Object1["A1"].["color"]="Blue";
</code></pre>

<p>so basically here is the question. I would like to create object "A1" under "mylib.Object" and immediately add property color = "blue" to "A1". I would need to do this for several other properties, but if I can figure out how to do this for one, I can figure it out for the rest. How can I accomplish this task?</p>

<p>No jQuery, please. Just plain old JavaScript is what I'm looking for.**</p>

<p>Once I create the object and properties I would imagine I can just use a <code>for</code> loop to loop through the properties for that object. Like so:</p>

<pre><code>for(key in mylib.Object1["A1"]){}
</code></pre>

<p>Right?</p>
