Array Creation Methods |
Array.from() |
Creates a new array instance from an array-like or iterable object. |
Array.isArray() |
Returns true if the argument is an array. |
Array.of() |
Creates a new array instance with a variable number of arguments, regardless of number or type of the arguments. |
Array Mutator Methods |
Array.prototype.copyWithin() |
Copies part of an array to another location in the same array. |
Array.prototype.fill() |
Fills all the elements of an array from a start index to an end index with a static value. |
Array.prototype.pop() |
Removes the last element from an array and returns that element. |
Array.prototype.push() |
Adds one or more elements to the end of an array and returns the new length of the array. |
Array.prototype.reverse() |
Reverses the order of the elements of an array in place. |
Array.prototype.shift() |
Removes the first element from an array and returns that element. |
Array.prototype.sort() |
Sorts the elements of an array in place and returns the array. |
Array.prototype.splice() |
Adds and/or removes elements from an array. |
Array.prototype.unshift() |
Adds one or more elements to the beginning of an array and returns the new length of the array. |
Accessor Methods |
Array.prototype.concat() |
Merges two or more arrays. |
Array.prototype.includes() |
Determines whether an array includes a certain value among its entries. |
Array.prototype.indexOf() |
Returns the first index at which a given element can be found in the array. |
Array.prototype.join() |
Joins all elements of an array into a string. |
Array.prototype.lastIndexOf() |
Returns the last index at which a given element can be found in the array. |
Array.prototype.slice() |
Returns a shallow copy of a portion of an array into a new array object. |
Array.prototype.toString() |
Returns a string representing the array and its elements. |
Array.prototype.toLocaleString() |
Returns a localized string representing the array and its elements. |
Iteration Methods |
Array.prototype.entries() |
Returns a new array iterator object that contains the key/value pairs for each index in the array. |
Array.prototype.every() |
Tests whether all elements in the array pass the test implemented by the provided function. |
Array.prototype.filter() |
Creates a new array with all elements that pass the test implemented by the provided function. |
Array.prototype.find() |
Returns the value of the first element in the array that satisfies the provided testing function. |
Array.prototype.findIndex() |
Returns the index of the first element in the array that satisfies the provided testing function. |
Array.prototype.forEach() |
Executes a provided function once for each array element. |
Array.prototype.keys() |
Returns a new array iterator that contains the keys for each index in the array. |
Array.prototype.map() |
Creates a new array with the results of calling a provided function on every element in the calling array. |
Array.prototype.reduce() |
Executes a reducer function on each element of the array, resulting in a single output value. |
Array.prototype.reduceRight() |
Executes a reducer function on each element of the array, from right to left, resulting in a single output value. |
Array.prototype.some() |
Tests whether at least one element in the array passes the test implemented by the provided function. |
Array.prototype.values() |
Returns a new array iterator object that contains the values for each index in the array. |
Array.prototype.flat() |
Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth. |
Array.prototype.flatMap() |
Maps each element using a mapping function, then flattens the result into a new array. |
Array.prototype[@@iterator]() |
Returns the default iterator for an array, which is the same as the values()
method. |