Members of the Same Type

This lesson explains how to have members in a type defined with an index signature.

Same type

The interface defined by members and an index type that uses a string as the key must have all its members to be of type string.

πŸ“œNote: the code below throws an error ❌

Get hands-on with 1200+ tech skills courses.