Created
December 22, 2016 01:33
-
-
Save xto3na/bdee0c7023716be08b3714f287262e38 to your computer and use it in GitHub Desktop.
Typescript - multidimensional array initialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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