title: JavaScript: Faster way to create and initialize two dimensional array (matrix)
body: <p>Is there a faster way to create and zero out a matrix?<br />
  Currently, my code involves two for loops:</p>
  
  <pre><code>var nodes = new Array(ast.length);
  
  for (var i=0; i &lt; nodes.length; i++){
      nodes[i] = new Array(ast.length);
      for (var j=0; j &lt; nodes.length; j++)
          nodes[i][j]=0;
  }
  </code></pre>