0% found this document useful (0 votes)
2 views1 page

JS Array Methods Table CheatSheet

This cheat sheet provides a comprehensive overview of JavaScript array methods, detailing whether each method accepts a callback, returns a new array, or mutates the original array. Key methods include forEach, map, filter, and reduce, each serving distinct purposes for array manipulation. The document serves as a quick reference for developers to understand and utilize these methods effectively.

Uploaded by

ekansh kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

JS Array Methods Table CheatSheet

This cheat sheet provides a comprehensive overview of JavaScript array methods, detailing whether each method accepts a callback, returns a new array, or mutates the original array. Key methods include forEach, map, filter, and reduce, each serving distinct purposes for array manipulation. The document serves as a quick reference for developers to understand and utilize these methods effectively.

Uploaded by

ekansh kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like