I am in reference to the typescript documentation about advanced types. See here.
The following example is given:
interface Map<T> {
[key: string]: T;
}
I understand the Map's type variable T.
My doubt is rather about the syntax within the interface declaration i.e. this exact line:
[key: string]: T;
Can someone please translate in english what the above line means?
And refer me to relevant documentation about the square brackets syntax for the key?