JavaScript Array Methods Cheat Sheet
The JavaScript array methods you reach for most, with what each returns and — crucially — whether it mutates the original array or returns a new one. Getting that column right prevents a whole class of bugs: methods like map and filter are safe because they leave the original untouched, while sort, reverse, and splice change it in place.
Updated 2026-07-06
| Method | What it does | Returns | Mutates |
|---|---|---|---|
| map() | Transform every element | New array | No |
| filter() | Keep elements that pass a test | New array | No |
| reduce() | Boil the array down to a single value | Any value | No |
| forEach() | Run a function for each element | undefined | No |
| find() | First element that passes a test | Element / undefined | No |
| findIndex() | Index of the first match | Index / -1 | No |
| some() | True if at least one passes | Boolean | No |
| every() | True if all pass | Boolean | No |
| includes() | Whether a value is present | Boolean | No |
| indexOf() | Index of a value | Index / -1 | No |
| slice() | Copy a portion of the array | New array | No |
| concat() | Merge arrays into a new one | New array | No |
| join() | Combine elements into a string | String | No |
| flat() | Flatten nested arrays | New array | No |
| flatMap() | map() then flatten one level | New array | No |
| at() | Element by index (supports negatives) | Element | No |
| push() | Add one or more items to the end | New length | Yes |
| pop() | Remove the last item | Removed item | Yes |
| shift() | Remove the first item | Removed item | Yes |
| unshift() | Add items to the start | New length | Yes |
| splice() | Add/remove items at any index | Removed items | Yes |
| sort() | Sort the array in place | The array | Yes |
| reverse() | Reverse the array in place | The array | Yes |
| fill() | Fill with a static value | The array | Yes |
| Array.from() | Create an array from an iterable | New array | No |
| Array.isArray() | Check if a value is an array | Boolean | No |
Tip: when you need a sorted copy without touching the original, spread first — [...arr].sort(). Modern JavaScript also adds non-mutating twins (toSorted, toReversed, toSpliced, with) that return a new array.