title: creating 2 dimension arrays
body: <p>I am new to JS and need some basic help:</p>
  
  <p>I have a spreadsheet which has a square matrix of data.</p>
  
  <p>I can read these data as follows:</p>
  
  <pre><code>  var freqArr     = new Array(new Array());
    var freqSheet   = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("freq");
    var freqRows    = freqSheet.getDataRange();
    var freqNumRows = freqRows.getNumRows();
    freqArr = freqSheet.getRange(2, 2, freqNumRows, freqNumRows).getValues();
  </code></pre>
  
  <p>I now want to create a an array in memory similar to the one I have read from the sheet</p>
  
  <pre><code> var tempArr = new Array(new Array());
    for (var i = 0; i &lt;= 3; i++) {
      for (var j = 0; j &lt;= 3; j++) {        
        tempArr [i][j] = freqArr[i][j] ;
      }
    }
  </code></pre>
  
  <p>As soon as j incs from 0 to 1 and I try to store anything in tempArr [i][j] I get an error "TypeError: Cannot set property "0.0" of undefined to "xxx"  </p>
  
  <p>I have tried every combination of creating tempArr that I can think of plus a few more.</p>