push(element1, element2, ...)
:
Adds one or more elements to the end of an array.
pop()
:
Removes and returns the last element of an array.
unshift(element1, element2, ...)
:
Adds one or more elements to the beginning of an array.
shift()
:
Removes and returns the first element of an array.
concat(array1, array2, ...)
:
Combines two or more arrays and returns a new array.
join(separator)
:
Joins all elements of an array into a string, separated by the specified separator.
slice(start, end)
:
Creates a new array containing a portion of the original array from start
to end
(end index not included).
splice(start, deleteCount, item1, item2, ...)
:
Changes the contents of an array by removing, replacing, or adding elements.
reverse()
:
Reverses the order of elements in an array.
sort(compareFunction)
:
Sorts the elements of an array in place, optionally using a custom comparison function.
filter(callback)
:
Creates a new array with all elements that pass the test implemented by the provided callback function.
map(callback)
:
Creates a new array by applying a callback function to each element of the original array.
forEach(callback)
:
Executes a provided callback function once for each array element.
find(callback)
:
Returns the first element in an array that satisfies the provided testing function.
findIndex(callback)
:
Returns the index of the first element in an array that satisfies the provided testing function.
every(callback)
:
Check if all elements in an array pass a provided test implemented by the callback function.
some(callback)
:
Checks if at least one element in an array passes a provided test implemented by the callback function.
reduce(callback, initialValue)
:
Applies a callback function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
reduceRight(callback, initialValue)
:
Applies a callback function against an accumulator and each element in the array (from right to left) to reduce it to a single value.
includes(element)
:
Checks if an array includes a certain element and returns true
or false
.
indexOf(element, fromIndex)
:
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
lastIndexOf(element, fromIndex)
:
Returns the last index at which a given element can be found in the array, or -1 if it is not present.