snippettypescriptCritical
Create strongly typed array of arrays in TypeScript
Viewed 0 times
arraytypescriptarraysstronglytypedcreate
Problem
In a language like C# I can declare a list of lists like:
Is there a similar way to declare a strongly typed array of arrays in TypeScript? I tried the following approaches but neither compiles.
List> list_of_lists;Is there a similar way to declare a strongly typed array of arrays in TypeScript? I tried the following approaches but neither compiles.
var list_of_lists:int[][];
var list_of_lists:Array;Solution
int is not a type in TypeScript. You probably want to use number:var listOfLists : number[][];Code Snippets
var listOfLists : number[][];Context
Stack Overflow Q#23161486, score: 223
Revisions (0)
No revisions yet.