Checking data "exists" in array?
<p>I have an small array of data which i want to check if my values im checking against exist in the array together.</p>

<p>This is how the data looks like from my console.log(astar);</p>

<p><a href="http://i.imgur.com/PqzG7.jpg" rel="nofollow">http://i.imgur.com/PqzG7.jpg</a></p>

<p>My attempt was:</p>

<pre><code> console.log(astar); // display array info
     for (i=0; i &lt; 50; i++){    
        for (j=0; j &lt; 50; j++){ 
        if( i in astar &amp;&amp; j in astar[i] ){
               abposx = getx(i);
               abposy = gety(j);
        ctx.fillStyle = "#000";
        ctx.fillRect (abposx,abposy,10,10);             
    }   
</code></pre>

<p>The idea is the "inner arrays" which have [0][1] positions im trying to see if "any" of them have [0] == i and [1] == j if so = true.</p>

<p>How should i alter it to work correctly &amp; most efficiently - so that it will draw when it is found in the arrays    </p>
