Calling the following lines of code in Google Apps Script causes an error:
var newSheetData = [[]]; newSheetData[1][1] = "1";
However, when these lines of code are called, no error is thrown:
var newSheetData = [[]]; newSheetData[0][1] = "1";
This means there is only one row defined in the 2d array according to the way I've defined it.
This is the only way I am aware of for declaring a 2d array in Google Apps Script.
How might I create a mutable 2d array of generic dimensions (as many as needed,) or even pre-define the size of a 2d array in Google Apps Script?