Step 3 / Select topic TypeScript Easy
What this bank covers
- Counting assignment type errors
- Mixed array literal inference
- Runtime typeof an array
- Inferred type of a let variable
- as const on an array literal
- Literal widening with let
- Narrowing a union with typeof
- Inference through reduce
- Literal widening in let declarations
- typeof narrowing on string | number
- else branch narrows away the checked member
- Switching on a discriminant property
- The `in` operator as a narrowing check
- Array.isArray as a type guard
- instanceof narrowing for class types
- Truthiness narrowing removes undefined
- Members must exist on every union member
- Equality narrowing on a literal union
- Narrowing an optional parameter with typeof "undefined"
- Interface declaration merging
- Type aliases cannot be redeclared
- Conflicting merged members
- Structural compatibility of interfaces and aliases
- Classes can implement type aliases
- Interfaces describe object shapes only
- What an interface may extend
- Merged interfaces at runtime
- Interfaces do not merge with type aliases
- Interfaces extending type aliases
- Generic identity function
- Explicit type argument must match the argument
- Constraining a type parameter with extends
- Generic classes
- Numeric constraints on type parameters
- keyof constraints reject unknown keys
- Default type parameters
- Generic interfaces with two type parameters
- Multiple type parameters in tuples
- Generic function with a fallback value
- Required strips optional modifiers
- Pick keeps only the named keys
- Omit removes the listed keys
- ReturnType extracts a function's result type
- Parameters yields a tuple of argument types
- Partial makes every property optional
- Readonly blocks property assignment
- Record builds an object type from keys and a value type
- Exclude removes members from a union
- Awaited unwraps nested promises
- Literal inference for const
- Assigning outside a literal union
- Returning literal union members
- Branching on string literal types
- Literal default parameter
- Boolean literal types
- as const on an object
- unknown blocks property access
- never as a return type
- never is assignable to everything
- narrowing unknown with typeof
- never for exhaustiveness checks
- any is not assignable to never
- any disables property checking
- narrowed unknown satisfies the return type
- any, unknown and never assignability
- Parameter properties
- private members
- Inheritance and super()
- Getters
- Static members
- Calling super methods
- Abstract classes
- Class field types
- readonly class fields
- Returning `this` from class methods
- Numeric enum auto-numbering
- Auto-increment after an explicit enum initializer
- Reverse mapping in numeric enums
- String enums have no reverse mapping
- const assertion on an array literal
- String enum member values
- const bindings cannot be reassigned
- Numeric enum members behave as numbers
- Class names are types, instances are plain objects
- Interfaces are erased before runtime
- Numeric enums survive compilation
- Casts are compile-time only
- Generics do not exist at runtime
- Enum values vs erased interfaces
- Optional properties are not created at runtime
- The `!` operator checks nothing at runtime
- `readonly` is enforced only by the compiler
- Type assertions are erased at runtime
- Literal widening in object literals
- Assigning to a literal union
- Literal widening through let
- Indexing an as const object with a literal union
- Narrowing an `unknown` parameter
- Computed numeric enum members
- Computed enum members and reverse mapping