JavaScript Array Methods - Cheat Sheet
Method Callback? Returns New Array? Mutates Original? Description
forEach() Yes No No Runs a function on each element
map() Yes Yes No Transforms each element and returns new array
filter() Yes Yes No Keeps elements that pass the test
find() Yes No No Returns the first element that passes the test
findIndex() Yes No No Returns index of first match or -1
some() Yes No No Returns true if at least one passes
every() Yes No No Returns true if all pass
reduce() Yes No No Reduces to single value (left to right)
reduceRight() Yes No No Reduces to single value (right to left)
flatMap() Yes Yes No Maps and flattens array one level
sort() Yes No Yes Sorts array in place
push() No No Yes Adds to end
pop() No No Yes Removes last element
shift() No No Yes Removes first element
unshift() No No Yes Adds to start
splice() No No Yes Adds/removes/replaces elements
slice() No Yes No Returns a section of the array
concat() No Yes No Joins arrays
reverse() No No Yes Reverses the array
fill() No No Yes Fills elements with a static value
copyWithin() No No Yes Copies within the same array
flat() No Yes No Flattens nested arrays
join() No No No Joins elements into a string
includes() No No No Checks for existence
indexOf() No No No Gets index of a value
at() No No No Accesses element by index
Page 1 - Generated on 2025-05-13