Demo mode — data resets on refresh.
Functions and Generics
Utility Types
Built-in Utility Types
TypeScript includes utility types that transform existing types. These are powerful tools for reducing boilerplate.
Common Utilities
Partial<T> makes all properties optional. Required<T> makes all required. Readonly<T> prevents mutation.
Pick<T, K> selects a subset of properties. Omit<T, K> excludes properties.
Record<K, V> creates an object type with specific key and value types.
Conditional Types
Conditional types let you express type relationships: T extends U ? X : Y. Combined with infer, they enable powerful type transformations.
Knowledge Check
1.What does Partial<T> do?
2.Which utility type creates an object type with key-value types?