Code Reference

Type Operators

TypeScript · Methods reference

TypeScript · Methods reference


📋 Overview

Type-level operators and keywords for narrowing and composition.

🔧 Methods

Operators

OperatorDescription
keyof TUnion of keys of T
typeof xType of value or typeof type query
T[K]Indexed access type
T & U / `TU`
T extends U ? X : YConditional type
infer UCapture type in conditional
readonly T / readonly T[]Readonly modifier
+? / -? / +readonly / -readonlyMapped type modifiers
as constLiteral/narrow readonly inference
satisfies TCheck type without widening
asserts / is predicatesType guard return annotations

💡 Examples

See parent topic notes for runnable snippets; this page is the complete method index.

⚠️ Pitfalls

  • Mutating methods return None in Python — do not chain sort() / reverse() expecting a new list.
  • Default JS sort() compares strings — pass (a,b) => a-b for numbers.
  • SQL function names differ by dialect — verify Postgres vs MySQL docs.
  • Django QuerySet.update() skips save() signals and auto auto_now fields on models.

On this page