Current location - Quotes Website - Personality signature - Type script index type mapping difference
Type script index type mapping difference
The difference between the two lies in the difference in concept.

1. Index type refers to the index attribute or index signature in the object text or interface, which is used to describe the type of key-value pair in the object. In TypeScript, the object text can be signed by an index, which means that the index can be used to access the properties in the object.

2.Map type is a built-in object provided by TypeScript to store key-value pairs. Map can store any type of keys and values, and keys are unique. Compared with ordinary JavaScript objects, Map provides some additional functions, such as traversing key-value pairs of Map objects.