JavaScript Array Methods

About This Index
This page is the JavaScript Array Methods index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn what an Array is on /js/array. Use this page when you need a specific API such as push(), map(), or filter().
Start with push(), map(), filter(), and find()—then browse search, reduce, and the methods that edit the array in place.
How to Call an Array Method
Instance methods use a dot; static helpers use Array:
const colors = ["red", "green"];
const nums = [1, 2, 3];
// Instance (Array.prototype)
colors.push("blue"); // mutates colors
nums.map(function (n) { // new array
return n * 2;
});
nums.filter(function (n) {
return n > 1;
});
// Static (on Array)
Array.isArray(colors); // true
Array.from("hi"); // ["h", "i"]
Array.of(1, 2, 3); // [1, 2, 3] JavaScript Array Methods Table
All method guides in this JavaScript tutorial series (39 tutorials).
Getting Started
6 methodsEssential methods for reading, adding, and removing elements.
| Method | Description | Tutorial |
|---|---|---|
at() | Retrieves an element at a specified index, including negative offsets from the end. | Open |
push() | Adds one or more elements to the end and returns the new length. | Open |
pop() | Removes and returns the last element, mutating the array. | Open |
shift() | Removes and returns the first element, shifting others down. | Open |
unshift() | Adds elements to the beginning and returns the new length. | Open |
slice() | Returns a shallow copy of a portion without mutating the original. | Open |
Search & Test
9 methodsFind values and check whether elements match a condition.
| Method | Description | Tutorial |
|---|---|---|
includes() | Checks whether an array contains a value; returns true or false. | Open |
indexOf() | Returns the first index of a value, or -1 if not found. | Open |
lastIndexOf() | Returns the last index of a value, searching backward. | Open |
find() | Returns the first element that satisfies a testing function. | Open |
findIndex() | Returns the index of the first element that passes a test. | Open |
findLast() | Returns the last element that satisfies a testing function. | Open |
findLastIndex() | Returns the index of the last element that passes a test. | Open |
some() | Returns true if at least one element passes a test function. | Open |
every() | Tests whether all elements pass a callback; returns true or false. | Open |
Transform & Aggregate
6 methodsMap, filter, flatten, and reduce data into new shapes.
| Method | Description | Tutorial |
|---|---|---|
map() | Creates a new array by transforming each element with a callback. | Open |
filter() | Creates a new array with elements that pass a test function. | Open |
flat() | Flattens nested arrays into a single-level array. | Open |
flatMap() | Maps each element then flattens the result by one level. | Open |
reduce() | Reduces the array to a single value by applying a callback left to right. | Open |
reduceRight() | Like reduce(), but processes elements from right to left. | Open |
In-Place Changes
5 methodsMethods that modify the original array directly.
| Method | Description | Tutorial |
|---|---|---|
splice() | Adds, removes, or replaces elements at a given index in place. | Open |
sort() | Sorts elements in place using an optional compare function. | Open |
reverse() | Reverses element order in place and returns the same array. | Open |
fill() | Fills all or part of an array with a static value, mutating the array. | Open |
copyWithin() | Copies a sequence of elements within the array to another index in place. | Open |
Iteration
4 methodsLoop over elements or expose iterators.
Combine & Immutable Updates
2 methodsMerge arrays or return updated copies without mutation.
String Conversion
4 methodsTurn arrays into readable strings.
| Method | Description | Tutorial |
|---|---|---|
join() | Joins all elements into a string with an optional separator. | Open |
toString() | Returns a comma-separated string of the array elements. | Open |
toLocaleString() | Returns a locale-aware string representing the array. | Open |
valueOf() | Returns the primitive value of the array (the array itself). | Open |
Static Methods
3 methodsArray constructor helpers — not called on an instance.
| Method | Description | Tutorial |
|---|---|---|
Array.from() | Creates an array from an iterable or array-like object. | Open |
Array.isArray() | Returns true if the value is an array, false otherwise. | Open |
Array.of() | Creates a new array from the arguments you pass in. | Open |
Frequently Asked Questions
Start with push()
Open the add-to-end guide—syntax, examples, and FAQs.
14 people found this page helpful
