I have been studying the Typescript advanced types documentation, available at this link.
Within the documentation, there is an example provided:
interface Map<T> {
[key: string]: T;
}
I grasp the concept of the type variable T in Map.
However, my confusion lies in the syntax used within the interface declaration, specifically in this line:
[key: string]: T;
Could someone explain in plain English what the above line signifies?
Additionally, can anyone point me towards resources explaining the usage of square brackets for keys in TypeScript interfaces?