Here is the code snippet...
export class Puzzle {
pieces : Piece[];
orderedPieces : Piece[][];
constructor(width: number, height: number){
this.height = height, this.width = width;
let total : number = width * height;
this.pieces = new Array<Piece>(total);
this.orderedPieces = new Piece[height][width]; // How should I properly initialize this?
}
...
}
In TypeScript, how can I correctly declare a structure like this?
The error message says...
Cannot read property '2' of undefined