Can't add an object inside an object
<p>I am looking some data to create a list of objects, i want to add some of the objects inside the parent object. Although the inner object gets created none of the properties get created with it...</p>

<p>This is what im trying to do:</p>

<pre><code>for(var i in data){
    if(parseInt(data[i].prevr) == 0){
        nodes[data[i].id] = new Object();
        nodes[data[i].id].name = data[i].name;
        nodes[data[i].id].child = new Object();
    }else if(parseInt(data[i].prevr) &gt; 0){  
        console.log('test');
        nodes[data[i].prevr].child[data[i].id] = new Object();
        nodes[data[i].prevr].child[data[i].id].name = data[i].name; 
    }
 }
console.log(JSON.stringify(nodes[5]));
</code></pre>

<p>The result shows this in console.log:</p>

<pre><code>test
{"name":"Test2","child":{}} 
</code></pre>

<p>Why won't it create the data for the child object?</p>

<p>My variable <code>data</code> holds:</p>

<pre><code>[{"id":"3","name":"Test2","prevr":"0"}
{"id":"4","name":"Test3","prevr":"3"}]
</code></pre>
