thecartesianman
thecartesianman

Reputation: 845

What is the Built-in Object Key type called?

I remember previously using a built in type that is the union of all possible object keys, and it was name objectKey or something similar.

For example:

type objectKey = string | number | symbol

However, I can’t remember the specific name now. Does anyone know what it is named?

Upvotes: 0

Views: 94

Answers (1)

Tobias S.
Tobias S.

Reputation: 23825

It is called PropertyKey.

declare type PropertyKey = string | number | symbol;

Upvotes: 3

Related Questions