2 Dimensional Array doesn't seem to work

Title says it all, here’s the code:

var grid = new Array();
var terrainSize = GetComponent(Terrain).terrainData.size;
for (var i = 0; i < terrainSize.x; i++) {
	grid.Push(new Array());
	for (var j = 0; j < terrainSize.z; j++) {
  • }*
    And when I try to run it I get the following error:
    > Assets/Scripts/TerrainManagement.js(9,33): BCE0019: ‘push’ is not a member of ‘Object’.
    Why are arrays not being created in the spaces in the grid 1D array?
    Sorry, I’ve probably done something stupid but I’m pretty new to JS so.

Never use the Array class; it’s slow and untyped. If you want a 2D array, use an actual 2D array, especially since that’s what TerrainData functions require:

var grid = new float[sizeX, sizeY];