Acknowledgement
Comment
According to the TypeScript Handbook, the syntax for an index signature requires a property name, as shown in the example:
interface StringArray {
[index: number]: string;
}
However, it seems like the following syntax could also work and might be more concise:
interface StringArray {
[number]: string;
}
Could you please clarify in the documentation why a property name (like index in the example above) is required in index signatures? It would be helpful to understand its purpose, especially when it seems unused in the object definition.