JavaScript
Array Methods
push() sort() indexOf()
pop() includes() lastIndexOf()
shift() slice() reverse()
unshift() map() concat()
find() filter() join()
some() reduce() toString()
every() forEach()
are
d sh
e an
lik
@linkinsunil swipe @officialskv
1
push()
Adds one or more elements to the end of
an array and returns the new length of the
array..
@linkinsunil swipe @officialskv
2
pop()
Removes the last element from an array
and returns that element.
@linkinsunil swipe @officialskv
3
shift()
Removes the first element from an array
and returns that element.
@linkinsunil swipe @officialskv
4
unshift()
Adds one or more elements to the
beginning of an array and returns the new
length of the array.
@linkinsunil swipe @officialskv
5
find()
Returns the value of the first element in the
array that satisfies the provided testing
function. Otherwise, undefined is returned.
@linkinsunil swipe @officialskv
6
some()
Tests whether at least one element in the
array passes the test implemented by the
provided function. It returns true if any
element passes the test, otherwise it
returns false.
@linkinsunil swipe @officialskv
7
every()
Tests whether all elements in the array
pass the test implemented by the provided
function. It returns true if all elements pass
the test, otherwise it returns false.
@linkinsunil swipe @officialskv
8
sort()
Sorts the elements of an array in place and
returns the sorted array. The default sort
order is built upon converting the elements
into strings, then comparing their
sequences of UTF-16 code units values.
@linkinsunil swipe @officialskv
9
includes()
Determines whether an array includes a
certain element, returning true or false as
appropriate.
@linkinsunil swipe @officialskv
10
slice()
Returns a shallow copy of a portion of an
array into a new array object selected
from start to end (end not included). The
original array will not be modified.
@linkinsunil swipe @officialskv
11
map()
Creates a new array with the results of
calling a provided function on every
element in the calling array.
@linkinsunil swipe @officialskv
12
filter()
Creates a new array with all elements that
pass the test implemented by the provided
function.
@linkinsunil swipe @officialskv
13
reduce()
Executes a reducer function on each
element of the array, resulting in a single
output value.
@linkinsunil swipe @officialskv
14
forEach()
Executes a provided function once for each
array element.
@linkinsunil swipe @officialskv
15
indexOf()
Returns the first index at which a given
element can be found in the array, or -1 if it
is not present.
@linkinsunil swipe @officialskv
16
lastIndexOf()
Returns the last index at which a given
element can be found in the array, or -1 if it
is not present.
@linkinsunil swipe @officialskv
17
reverse()
Reverses the order of the elements of an
array in place. The first element becomes
the last, and the last element becomes the
first.
@linkinsunil swipe @officialskv
18
concat()
Returns a new array that includes
elements from the original array and
additional elements.
@linkinsunil swipe @officialskv
19
join()
Joins all elements of an array into a string.
The elements are separated by a specified
separator string.
@linkinsunil swipe @officialskv
20
toString()
Returns a string representing the specified
number or array and its elements.
@linkinsunil swipe @officialskv
share
and
like
Frontend Developer