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
| API | Description |
|---|---|
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 tuples | Literal readonly tuples |
.includes() narrowing | With literal union and as const |
NoInfer<T> | Block inference in generics (5.4+) |
Same as JS (see JS Methods)
| Category | Link concept |
|---|---|
| Array prototype | map, filter, reduce, find, … |
| String prototype | slice, split, replace, … |
| Object static | keys, entries, assign, … |
| Promise static | all, race, allSettled, … |
💡 Examples
See parent topic notes for runnable snippets; this page is the complete method index.
⚠️ Pitfalls
- Mutating methods return
Nonein Python — do not chainsort()/reverse()expecting a new list. - Default JS
sort()compares strings — pass(a,b) => a-bfor numbers. - SQL function names differ by dialect — verify Postgres vs MySQL docs.
- Django
QuerySet.update()skipssave()signals and autoauto_nowfields on models.