Looking for a less verbose way of creating hierarchical data in a multidimensional object
<p>If I want to create a new node in a multidimensional object I have to check that the parent objects exist before adding it. eg</p>

<pre><code>if(typeof root_object["object1"] == "undefined")
    root_object["object1"] = [];
if(typeof root_object["object1"]["object2"] == "undefined")
    root_object["object1"]["object2"] = [];
root_object["object1"]["object2"]["object3"] = something_or_other;
</code></pre>

<p>Is there an easier less verbose way of achieving this?</p>
