object literal

An object written out in code with curly braces, such as { id: "usr_100", email: "alex@example.com" }.

In more detail

TypeScript infers a type from an object literal's properties. Object literals written directly where a type is expected get excess property checking. Adding as const makes all its properties readonly literal types.

Related terms

Taught in

References