Converting PHP code into JS
<p>I have this PHP code - </p>

<pre><code> &lt;?php
for($i=1; $i&lt;=1000; $i++) {
  $array=array();
  $array[$i]=54*$i;

  $arr=array($array[$i].",");

  foreach ($arr as $value) {
    echo $value;
  }
}
?&gt;
</code></pre>

<p>I tried with:</p>

<pre><code>var i;
for(i=1;i&lt;=1000;i++) {
  var array = new Array();
  array[i] = 54*i;
  var arr = new Array();
  arr.push(array[i]+",");
}
alert(arr)
</code></pre>

<p>But it doesn't work.
Where's the mistake?</p>
