Object values undefined and NaN
<p>I have a function which creates an object of values, but im getting this in my console log:</p>

<pre><code> x: Array[4]
 0: undefined
 1: NaN
 2: undefined
 3: NaN
 length: 4
 y: Array[4]
 0: undefined
 1: NaN
 2: undefined
 3: NaN
 length: 4
</code></pre>

<p>The function loops on an object created from a PHP file which was json encoded:</p>

<pre><code> var sdata = {"4":{"7":["1","7","2","2"]},"3":{"3":["2","8","1","1"]}};
</code></pre>

<p>My function is:</p>

<pre><code>function populate_collisions(){
gcollision = { 
    x: [],
    y: []    
    };

for(var key in sdata){
    gcollision.x.push( sdata[key][0] );
    gcollision.x.push( sdata[key][0] + (sdata[key][2]-1) );
    gcollision.y.push( sdata[key][1] );
    gcollision.y.push( sdata[key][1] + (sdata[key][3]-1) );
}
console.log(gcollision);
}
</code></pre>

<p>I'm curious to know why im getting undefined and NaN? And how do i solve the problem?</p>
