Array API

The Array global object is a constructor for arrays.

44 Total 41 Methods 3 Properties 5 Statics
  Show all

new Array(…)

Creates a new Array instance.Array.Array([elementN])

[Symbol.iterator]()

Returns a new Array Iterator object that contains the values for each index in the array.a[Symbol.iterator]()

[Symbol.unscopables]

Contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for with statement-binding purposes.a[Symbol.unscopables]

at()

Returns the array item at the given index. Accepts negative integers, which count back from the last item.a.at()

concat()

Returns a new array that is this array joined with other array(s) and/or value(s).a.concat()

constructor()

Specifies the function that creates an array's prototype.a.constructor()

copyWithin()

Copies a sequence of array elements within the array.a.copyWithin()

entries()

Returns a new Array Iterator object that contains the key/value pairs for each index in the array.a.entries()

every()

Tests whether all elements in the array pass the test implemented by the provided function.a.every()

fill()

Fills all the elements of an array from a start index to an end index with a static value.a.fill()

filter()

Creates a new array with all elements that pass the test implemented by the provided function.a.filter()

find()

Returns the value of the first element in the array that satisfies the provided testing function.a.find()

findIndex()

Returns the index of the first element in the array that satisfies the provided testing function.a.findIndex()

findLast()

Returns the value of the last element in the array that satisfies the provided testing function.a.findLast()

findLastIndex()

Returns the index of the last element in the array that satisfies the provided testing function.a.findLastIndex()

flat()

Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.a.flat()

flatMap()

Maps each element using a mapping function, then flattens the result into a new array.a.flatMap()

forEach()

Executes a provided function once for each array element.a.forEach()

Array.from()

Creates a new Array instance from an array-like or iterable object.Array.from()

includes()

Determines whether an array includes a certain value among its entries.a.includes()

indexOf()

Returns the first index at which a given element can be found in the array, or -1 if it is not present.a.indexOf()

Array.isArray()

Returns a Boolean value indicating whether the argument is an Array.Array.isArray()

join()

Joins all elements of an array into a string.a.join()

keys()

Returns a new Array Iterator that contains the keys for each index in the array.a.keys()

lastIndexOf()

Returns the last index at which a given element can be found in the array, or -1 if it is not present.a.lastIndexOf()

length

The length property of an array is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array.a.length

map()

Creates a new array with the results of calling a provided function on every element in the calling array.a.map()

Array.of()

Creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments.Array.of()

pop()

Removes the last element from an array and returns that element.a.pop()

Array.prototype

The initial value of Array.prototype is the Array prototype object. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.Array.prototype

push()

Adds one or more elements to the end of an array and returns the new length of the array.a.push()

reduce()

Executes a reducer function on each element of the array, resulting in a single output value.a.reduce()

reduceRight()

Applies a function against an accumulator and each value of the array (from right-to-left) to reduce it to a single value.a.reduceRight()

reverse()

Reverses the order of the elements of an array in place.a.reverse()

shift()

Removes the first element from an array and returns that element.a.shift()

slice()

Returns a shallow copy of a portion of an array into a new array object.a.slice()

some()

Tests whether at least one element in the array passes the test implemented by the provided function.a.some()

sort()

Sorts the elements of an array in place and returns the sorted array.a.sort()

splice()

Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.a.splice()

toLocaleString()

Returns a string representing the array and its elements using the current locale.a.toLocaleString()

toString()

Returns a string representing the array and its elements.a.toString()

unshift()

Adds one or more elements to the beginning of an array and returns the new length of the array.a.unshift()

values()

Returns a new Array Iterator object that contains the values for each index in the array.a.values()

with()

Returns a new array with the element at the given index replaced with the given value.a.with()

[Symbol.iterator]()

method

Returns a new Array Iterator object that contains the values for each index in the array. a[Symbol.iterator]()

You seem to be offline. App may not work.