For loop with array unexpected identifier
<p>I have two arrays which im checking against in a for loop, but am stuck on how to make the for loop work on the array.</p>

<p>The array is build like this in json_encode:</p>

<pre><code>var bdata = {"1":["50","50","0","Player1"],"2":["1500","1000","1000","Player2"]};
</code></pre>

<p>The array i am comparing it against is encoded like this:</p>

<pre><code>var vdata = {"uid":"1","total":"1","w":"1","t":"1","s":"1","g":"1","l":"0","upd":"0"};
</code></pre>

<p>Then i tried to create the loop by converting them into arrays but it does not work:</p>

<pre><code>bdata = JSON.parse(bdata);
vdata = JSON.parse(vdata);
    for(bdata[0] as bid){
    if(vdata["w"] &gt;= bdata[bid][1] &amp;&amp; vdata["g"] &gt;= bdata[bid][0] &amp;&amp; vdata["s"] &gt;= bdata[bid][2]){
document.getElementById(id).innerHTML += "&lt;br/&gt;"+bdata[bid][3];     
        }else{
document.getElementById(id).innerHTML += "&lt;br/&gt;&lt;font color='red'&gt;"+bdata[bid][3]+"&lt;/font&gt;";     
        }
    }
</code></pre>

<p>But the error i get is : Unexpected identifier</p>

<p>I'm not even sure im looping the first array correctly ?</p>
