Closed
Description
Acknowledgement
- I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
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.
Metadata
Metadata
Assignees
Labels
No labels