Javascript and variable scope
<p>I have the need to create a two dimensional array to collect values in my jsp. In order to populate the 2-d array I'm using code like this </p>

<pre><code> &lt;script language="JavaScript"&gt;
     var row = 0;
     var multiDimenArray = new Array();
 &lt;/script&gt;
 &lt;c:forEach var="items" items="${item}" varStatus="status"&gt;
      ............
      &lt;script language="JavaScript"&gt;
          multiDimenArray [row] = new Array();
          var column = 0;
          row++;
     &lt;/script&gt;
     &lt;c:forEach var="nestedItems" items="${nestedItem}" varStatus="status"&gt;
        ............
           &lt;script language="JavaScript"&gt;
                multiDimenArray [row][column] = "some value";
                column++;
           &lt;/script&gt;
</code></pre>

<p>However in the third script block when i attempt to assign the value i get a JS error saying that the variable row is undefined. Is it possible to pass variables between script blocks like this in JS?</p>
