Just a quick note, you don't actually have to explicitly state the type of map
in TypeScript. The type will be inferred from the initializer.
However, if you prefer to specify it, you have two options:
1. It can be an array of arrays of strings: string[][]
/ Array<Array<string>>
let map: string[][] = [ ['key1', 'value1'],['key2', 'value2'] ] ;
(This is the default type that TypeScript will infer.)
Playground link
or
2. Alternatively, it could be an array of string
,string
tuples: [string, string][]
/ Array<[string, string]>
let map: [string,string][] = [ ['key1', 'value1'],['key2', 'value2'] ] ;
Playground link
Tuple types...
...allow you to define an array with a fixed number of elements where the types are known but not necessarily the same.