what's wrong with this code?
<p>What's wrong with the following code?  </p>

<pre><code>   for (var x=0;x&lt;8;x++){
      for (var y=0;y&lt;8;y++){
        table[y][x]=new Peon("black",x,y,table);
      }
   {
</code></pre>

<p>I know that there's something wrong because if I remove it from the code bellow it works, if I leave it there it never reaches the second "alert".</p>

<pre><code>  &lt;HTML&gt;
    &lt;HEAD&gt;
      &lt;TITLE&gt;Chess&lt;/TITLE&gt;
      &lt;SCRIPT LANGUAGE="JavaScript"&gt;
      var table = [];


      function Peon(color,posX,posY,board){
        this.color=color;
        this.posX=posX;
        this.posY=posY;
        this.board=board; //reference to the game board

        this.move = function(x,y){
          /*
          board[posY][posX]=null;
          board[y][x]= this;

          posX=x;
          posY=y;
          */
          alert("x "+x+" y "+y);
        };
        this.isValidMove = function(x,y){ return false;};
        return true;
      }

      //Board Inizialization 
      for (var i=3;i&lt;5;i++){
          table[i]=[];
      }

      for (var x=0;x&lt;8;x++){
          for (var y=0;y&lt;8;y++){
            table[y][x]=new Peon("black",x,y,table);
          }
      }


      var n = new Peon("black",0,0,table);


      function move(x, y) {
        alert("debug");

        n.move(x+1,y+1);
        alert("debug 2");

          //Check if there is a piece already selected
           //no Check if selection is valid
               //yes Select
               //no Do nothing
           //Click on owned piece?
               //yes Change selection if valid
               //no Is move valid?
                   //yes move/eat
                   //no Do nothing
      }


      &lt;/SCRIPT&gt;
    &lt;/HEAD&gt;
    &lt;BODY&gt;

      &lt;INPUT id="b00" TYPE="button" style="background-color:EEEEEE" Value="Click" onClick="move(0,0)"&gt;

      &lt;div id="writeHere"&gt;&lt;/div&gt;
    &lt;/BODY&gt;
  &lt;/HTML&gt;
</code></pre>
