TypeScript - Objects

In JavaScript, almost everything is an object. You need to know how to define an object's type to handle them safely inside your code

Object type

I can define simple object types, including objects containing optional keys

Generic object type

I know how I can create a type that will have a dynamic keys using index signature or Record utility type

Readonly keys

I know how to mark specific object keys as readonly properties

Intersection of objects

I know what will be a result of types' intersection (& operator)

I understand how the final type is generated based on the keys and value types of the intersected types

Lookup types

I know that I can access the type of a specific property of an object type and reuse it

Icon of TypeScript
Icon of Objects
TypeScript skill
core
Objects
Ready to learn
Required technologies

I can define simple object types, including objects containing optional keys

I know how I can create a type that will have a dynamic keys using index signature or Record utility type

I know how to mark specific object keys as readonly properties

I know what will be a result of types' intersection (& operator)

I understand how the final type is generated based on the keys and value types of the intersected types

I know that I can access the type of a specific property of an object type and reuse it

Close
Loading content