title: Getting regular pattern when trying to randomize the element in a two dimensional array with javascript
body: <p>I want to generate a chess board with fixed cols and rows and randomize the number (stand for the status) in it.Here is the code:</p>
  
  <pre><code>function Board(){
    this.board = new Array(10).fill(new Array(10).fill(0));
  }
  Board.prototype.renew = function(){
    this.board = new Array(10).fill(new Array(10).fill(0));
  }
  Board.prototype.randomize = function(){
    for(i=0;i&lt;10;i++){
      for(j=0;j&lt;10;j++)this.board[i][j] = Math.floor(Math.random()+0.5);
    }
  }
  
  var apple = new Board();
  
  apple.randomize();
  
  console.log(apple.board.join("\n"));
  </code></pre>
  
  <p>Then I got this:</p>
  
  <pre><code>0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  0,1,1,0,1,0,0,1,0,0
  </code></pre>
  
  <p>I didn't expect that it seems to have some regular pattern among rows.I run this several times.Although I get different value inside a row, all rows still share the same pattern.</p>