Code Reference

Class & Interface Methods

TypeScript · Methods reference

TypeScript · Methods reference


📋 Overview

Class members, access modifiers, and interface method signatures.

🔧 Methods

Class members

MemberDescription
constructor(...)Initialize instance
method() / get / setInstance methods and accessors
static method()On constructor function
#privateFieldTrue private (ES2022)
protected / private / publicVisibility modifiers
readonly propAssign-once property
abstract class / abstract methodMust be implemented by subclass
implements IClass satisfies interface contract
overrideExplicit override of base method (4.3+)

Interface / type shapes

FormDescription
interface I \{ fn(): void \}Callable method signature
type F = (x: T) => RFunction type alias
Optional prop?: TMay be undefined
Index signature [k: string]: TDynamic keys

💡 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