Setting an object as a new property in another object
<p>I have basically created a main object like below:</p>

<pre><code>var seriesOptions = {
y: +parseFloat($(this).find('y').text()).toFixed(2),
color: colors[index],
level : dlevel
};
</code></pre>

<p>Now I keep adding new property with values to the above object like:</p>

<pre><code>var drilldown {
name : $(series).children('name').text(),
level : dlevel + 1,
color: colors[index]
};

var data {
values : []
}

for .. each 
  data.values.push(..)

drilldown['data'] = data;
seriesOptions['drilldown'] = drilldown;  
</code></pre>

<p>The above code goes in an main for .. each loop. So when the main loop ends I have something like below object layout:</p>

<pre><code>seriesOptions
             drilldown
                      data
                          drilldown
                                  data
......................................
</code></pre>

<p>Now I want to access the last data node of a particular name in seriesOptions - as per example above for last 'drilldown' note in seriesOptions would be <strong>seriesOptions.drilldown.data.drilldown</strong> - how can I access the last object of type data in seriesOptions? I want to add another property and its values to it like:</p>

<pre><code>seriesOptions
             drilldown
                      data
                          drilldown
                                  data
                                  &lt;finalobject&gt;
</code></pre>
