title: Global Variable value not usable in multiple functions
body: <p>Using Google Apps Script I'm trying to create a global variable (e.g. an array) that can be used in multiple functions, but I can't seem to find the answer anywhere and I need it for my Google Spreadsheet to work.</p>
  
  <p>Code:</p>
  
  <pre><code>var infoSheetArray = null;
  
  function onOpen() {
    var ui = SpreadsheetApp.getUi();
    ui.createMenu('Custom Menu')
        .addItem('Fetch Info', 'grabInfo')
        .addItem('Run Program', 'itemSetup')
        .addToUi();
  }
  
  function grabInfo() {
    var infoSheet = SpreadsheetApp.openByUrl('....');
    infoSheetArray = infoSheet.getSheetValues(1, 1, infoSheet.getLastRow(), 10);
  }    
  </code></pre>