I'm working on creating a 5x4 grid array in typescript and I'm struggling with properly instantiating it. When trying to push an element into the array using the method for a one-dimensional array, it's not working as expected and giving me an error message indicating that my array has 0 lines.
export class Grid {
public mainGrid: string[][];
public constructor() {
this.mainGrid = new Array<Array<string>>(5)(4);
}
}
Should I be pushing a new Array(5) multiple times instead?