What is the name of the index type in TypeScript?

the following code is a description of the interface for index types in the TypeScript tutorial, which I never understood. May I ask whose attributes this length and name belong to? What did he rule? Is length the length of the index type? Is name the return type of the interface or something?

interface NumberDictionary {
  [index: string]: number;
  length: number;    // lengthnumber
  name: string       // `name`
}
Dec.25,2021

length and name are attributes of NumberDictionary.

What is stipulated in

, literally, it should be the length and name of the dictionary.

this length is just an attribute defined, not the length of the index type.

name is also an attribute. Because this index type returns the number type, and here name defines the string type, there is an error.

you can define what you need here. For example, you also need to know the price of this NumberDictionary. You can add another attribute by yourself

.
interface NumberDictionary {
  [index: string]: number;
  length: number;    // lengthnumber
  name: string;       // `name`
  price: number  
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7ad6e0-24607.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7ad6e0-24607.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?