title: Defining arrays in Google Scripts
body: <p>I'm a javascript newbie and trying to write a script for a spreadsheet that will pull various things out of it. Right off the bat, I'm having trouble defining an array of names that will be in the spreasheet. The error says "Missing ; before statement (line 10)"</p>
  
  
  
  <pre><code>function readRows() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var rows = sheet.getDataRange();
    var numRows = rows.getNumRows();
    //var values = rows.getValues();
  
    var Names = sheet.getRange("A2:A7");
    var Name = new Array(6);
    var Name_cell = Names.getCell(1, 1);
    var Name[0] = Name_cell.getValue();  //  &lt;-- Here's the issue
    var Name_cell = Names.getCell(2, 1);
    var Name[1] = Name_cell.getValue();
    var Name_cell = Names.getCell(3, 1);
    var Name[2] = Name_cell.getValue();
    var Name_cell = Names.getCell(4, 1);
    var Name[3] = Name_cell.getValue();
    var Name_cell = Names.getCell(5, 1);
    var Name[4] = Name_cell.getValue();
    var Name_cell = Names.getCell(6, 1);
    var Name[5] = Name_cell.getValue();
  
    // ...
  }
  </code></pre>