Code Reference

Array & Object Methods (Typed)

TypeScript · Methods reference

TypeScript · Methods reference


📋 Overview

Runtime methods same as JavaScript; TypeScript adds typed array helpers and readonly variants.

🔧 Methods

Typed array helpers

APIDescription
ReadonlyArray<T> / readonly T[]Immutable array type
Readonly<T>Shallow readonly object
Array<T> / T[]Mutable array syntax
Tuple types [T, U]Fixed-length typed arrays
as const tuplesLiteral readonly tuples
.includes() narrowingWith literal union and as const
NoInfer<T>Block inference in generics (5.4+)

Same as JS (see JS Methods)

CategoryLink concept
Array prototypemap, filter, reduce, find, …
String prototypeslice, split, replace, …
Object statickeys, entries, assign, …
Promise staticall, race, allSettled, …

💡 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