The JavaScript array methods cheatsheet is a complete quick reference for every built-in method on Array.prototype. Each entry shows the method signature, return value, whether it mutates the original array, a practical code example, and a one-click copy button — so you spend less time searching MDN and more time shipping code.
No methods found
Try a different search term or select a different category
How to Use This JavaScript Array Methods Cheatsheet
This interactive JavaScript array methods reference puts every built-in array method at your fingertips. Whether you are learning the difference between map and forEach, looking up the exact signature for reduce, or checking whether splice mutates the array, you can find the answer in seconds without leaving your browser.
Searching for Methods
Type any keyword into the search bar to instantly filter methods. You can search by method name (e.g., flat), by a concept (e.g., "sort"), or by a term that appears in the example code (e.g., "accumulator"). Results update live as you type. Click Clear or delete the text to return to the full list.
Filtering by Category
Use the category tabs to focus on a specific group of methods: Iteration covers methods that loop over elements (forEach, map, filter, reduce, flatMap); Search covers methods that locate elements (find, findIndex, indexOf, includes); Testing covers boolean tests (some, every); Transform covers methods that reshape arrays (sort, reverse, flat, slice, splice, concat); Add / Remove covers push, pop, shift, and unshift; Static covers Array.from, Array.of, and Array.isArray; and Other covers iterators, at, and toString.
Understanding the Method Cards
Each card shows four pieces of information. The signature at the top shows the method name and its parameters with type hints — angle brackets like (callback) are required, and square brackets like [initial] indicate optional parameters. The Returns line tells you what the method gives back. The Mutates badge — red for yes, green for no — tells you at a glance whether the original array is changed. The code example shows a short, realistic usage you can copy directly into your project.
Copying Code Examples
Every method card has a Copy button at the top right. Click it to copy the full code example to your clipboard, then paste it into your editor. The button briefly shows "Copied!" to confirm the action, then resets automatically.
Mutating vs Non-Mutating Methods
Understanding mutation is critical in modern JavaScript — especially when working with React state, Redux, or functional patterns. Mutating methods modify the original array in place: push, pop, shift, unshift, splice, sort, reverse, fill, and copyWithin. Non-mutating methods leave the original unchanged and return a new value: map, filter, slice, concat, reduce, flat, and the ES2023 additions toSorted, toReversed, toSpliced, and with. When in doubt, prefer non-mutating methods or spread the array first ([...arr].sort()) to avoid unexpected side effects.
Frequently Asked Questions
Is this JavaScript array methods cheatsheet free?
Yes, completely free with no signup, no account, and no payment required. All method references, examples, and copy buttons are available instantly in your browser.
Is my data safe when using this cheatsheet?
Absolutely. This cheatsheet runs entirely in your browser with no server interaction. Nothing is collected, stored, or transmitted anywhere.
What is the difference between map and forEach?
Both iterate over every element in an array, but map returns a new array containing the return value of each callback call, while forEach always returns undefined. Use map when you need a transformed array, and forEach when you only need to run side effects.
Which array methods mutate the original array?
Mutating methods include push, pop, shift, unshift, splice, sort, reverse, and fill. Non-mutating methods that return a new array or value include map, filter, slice, concat, reduce, find, findIndex, some, every, flat, flatMap, and the ES2023 methods toSorted, toReversed, toSpliced, and with.
What does reduce do and when should I use it?
reduce executes a callback for each element, accumulating a single result — like summing numbers, flattening arrays, or building an object from an array. It takes a callback with parameters (accumulator, currentValue, index, array) and an optional initial value. Use it when you need to derive a single value from an entire array.
What is the difference between find and filter?
find returns the first element that passes the test function, or undefined if none match. filter returns a new array containing all elements that pass the test. Use find when you expect at most one match, and filter when you need all matching elements.
What are the ES2023 non-mutating array methods?
ES2023 introduced four non-mutating counterparts to classic mutating methods: toSorted (like sort but returns a new array), toReversed (like reverse but returns a new array), toSpliced (like splice but returns a new array), and with (replaces an element at an index and returns a new array). They are supported in all modern browsers.
What is the difference between indexOf and includes?
includes returns a boolean (true or false) indicating whether the array contains the value. indexOf returns the numeric index of the first occurrence, or -1 if not found. Use includes for simple presence checks and indexOf when you need the position. Note that includes uses SameValueZero comparison, which correctly handles NaN, while indexOf does not.