On this page
Array
Prev: Object | Up: builtins | Next: Promise
Rel: Array & Typed Arrays Guide, Prototype Chain & new Flow
Ref: MDN Web Docs — Array
Tags: #public #web #javascript #builtins #array #index
Overview
Ordered, dynamically sized lists with functional iteration and ES2023 non-mutating copy methods.
Core (#tier/core)
- Array.map — Returns a new array with
fnapplied to every element without mutatingarr. - Array.filter — Returns a new shallow-copied array containing only elements where
predicatereturns truthy. - Array.reduce — Reduces array elements left-to-right into a single accumulated value.
- Array.find — Returns the first element matching
predicate, orundefined(short-circuits on first match). - Array.flatMap — Maps each element and flattens the result by one level in a single pass.
- Array.includes — Returns
trueifarrcontainsvalueusing SameValueZero (handlesNaNcorrectly). - Array.some — Returns
trueif at least one element satisfiespredicate(short-circuits);every()requires all. - Array.at — Returns the element at
index, supporting negative indexing from the end (arr.at(-1)). - Array.toSorted — Non-mutating ES2023 counterpart to
sort()returning a newly sorted array. - Array.isArray — Reliably checks whether
valueis an Array, even across iframes/realms.
Standard (#tier/standard)
- Array.from — Creates a shallow-copied
Arrayfrom any iterable (Set,NodeList, string) or array-like{ length }. - Array.sort — Sorts
arrin place (mutates the original array) and returnsarr. - Array.splice — Mutates
arrin place by removing and/or inserting elements; returns removed elements.
Linked from
- tuts/javascript/builtins
- tuts/javascript/builtins/Array/at
- tuts/javascript/builtins/Array/filter
- tuts/javascript/builtins/Array/find
- tuts/javascript/builtins/Array/flatMap
- tuts/javascript/builtins/Array/from
- tuts/javascript/builtins/Array/includes
- tuts/javascript/builtins/Array/isArray
- tuts/javascript/builtins/Array/map
- tuts/javascript/builtins/Array/reduce
- tuts/javascript/builtins/Array/some
- tuts/javascript/builtins/Array/sort
- tuts/javascript/builtins/Array/splice
- tuts/javascript/builtins/Array/toSorted
- tuts/javascript/builtins/Object
- tuts/javascript/builtins/Object/hasOwnProperty
- tuts/javascript/builtins/Promise
Related notes
- tuts/javascript/builtins Linked here; links to this page; shared tags: #builtins, #index, #javascript, #web
- tuts/javascript/builtins/Array/at Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/filter Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/find Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/flatMap Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/from Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/includes Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/isArray Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/map Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web
- tuts/javascript/builtins/Array/reduce Linked here; links to this page; shared tags: #array, #builtins, #javascript, #web