Instance of Array returning error
<p>I have a simple check to see if a particular set of keys is an array and if not create it but for some reason the if statement returns an error, this is what I am trying to do:</p>

<pre><code>//test data
var i = 0;
var map = new Array(); 
var Data[i]['x'] = 6;
var Data[i]['y'] = 7;

if(!map[Data[i]['x']] instanceof Array){
   map[Data[i]['x']] = new Array();
}

if(!map[Data[i]['x']][Data[i]['y']] instanceof Array){ //error on this line
   map[Data[i]['x']][Data[i]['y']] = new Array();
}
</code></pre>

<p>The error is:</p>

<p><code>Uncaught TypeError: Cannot read property '6' of undefined</code></p>

<p>This error is occuring on the second IF statement. What is the mistake I am making here?</p>
