Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xto3na/bdee0c7023716be08b3714f287262e38 to your computer and use it in GitHub Desktop.
Save xto3na/bdee0c7023716be08b3714f287262e38 to your computer and use it in GitHub Desktop.
Typescript - multidimensional array initialization
class Something {
private things: Thing[][];
constructor() {
things = [];
for(var i: number = 0; i < 10; i++) {
this.things[i] = [];
for(var j: number = 0; j< 10; j++) {
this.things[i][j] = new Thing();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment