Allow for indexable types other than string
and number
#19538
Labels
Duplicate
An existing issue was already created
string
and number
#19538
Given the following definition of a user and a user map,
We can insert another user into the map by using a variable of type
UserId
,However, I was surprised to find out that the indexable type can't be defined using the UserId type,
I'm sure we would all appreciate the certainty of knowing that the value we're using as an index is of the proper type, to avoid situations like
Is this a viable feature to include in TypeScript?
The text was updated successfully, but these errors were encountered: