In a language like C# I can declare a list of lists like:
List> list_of_lists;
Is there a similar way to declare a strong
@Eugene you can use something like Array<Array<[string, number]>>
to define a Map type
You do it exactly like in Java/C#, e.g. (in a class):
class SomeClass {
public someVariable: Array<Array<AnyTypeYouWant>>;
}
Or as a standalone variable:
var someOtherVariable: Array<Array<AnyTypeYouWant>>;
The simplest is:
x: Array<Array<Any>>
And, if you need something more complex, you can do something like this:
y: Array<Array<{z:int, w:string, r:Time}>>
int
is not a type in TypeScript. You probably want to use number
:
var listOfLists : number[][];