For simplicity, let us have an array that is regular at the beginning; that is, an array whose number of rows and columns can be determined at the beginning by passing two arguments to the constructor function. The array will have the properties and methods described in the previous part. For easy reference, I repeat the properties and methods here.
height: Number of rows in the array.
insertRow: to insert a row in the array.
deleteRow: to delete a row.
I will show you how to add other methods.
For simplicity, when a row is inserted, it will be blank; that is, it will have no cells. I will show you how to give contents to the cells of the rows. The 2D array may end up with rows of different lengths.