Does it mutate šŸ˜±

Array.prototype.concat

No mutation

Description

The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array.

Array.prototype.concat ( [ item1 [ , item2 [ , ā€¦ ] ] ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat

Example

Loadingā€¦

Array.prototype.copyWithin()

Mutates

Description

The copyWithin() method shallow copies part of an array to another location in the same array and returns it, without modifying its size.

arr.copyWithin(target)
arr.copyWithin(target, start)
arr.copyWithin(target, start, end)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin

Example

Loadingā€¦

Array.prototype.entries()

No mutation

Description

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

a.entries()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries

Example

Loadingā€¦

Array.prototype.every

No mutation

Description

The every() method tests whether all elements in the array pass the test implemented by the provided function.

Array.prototype.every ( callbackfn [ , thisArg ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every

Example

Loadingā€¦

Array.prototype.fill()

Mutates

Description

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

arr.fill(value)
arr.fill(value, start)
arr.fill(value, start, end)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill

Example

Loadingā€¦

Array.prototype.filter

No mutation

Description

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

Array.prototype.filter ( callbackfn [ , thisArg ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

Example

Loadingā€¦

Array.prototype.find()

No mutation

Description

The find() method returns a value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.

arr.find(callback[, thisArg])

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find

Example

Loadingā€¦

Array.prototype.findIndex()

No mutation

Description

The findIndex() method returns an index of the first element in the array that satisfies the provided testing function. Otherwise -1 is returned.

arr.findIndex(callback[, thisArg])

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex

Example

Loadingā€¦

Array.prototype.forEach

No mutation

Description

The forEach() method executes a provided function once per array element.

Array.prototype.forEach ( callbackfn [ , thisArg ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

Example

Loadingā€¦

Array.prototype.includes()

No mutation

Description

The includes() method determines whether an array includes a certain element, returning true or false as appropriate.

arr.includes(searchElement)
arr.includes(searchElement, fromIndex)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

Example

Loadingā€¦

Array.prototype.indexOf

No mutation

Description

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

Array.prototype.indexOf ( searchElement [ , fromIndex ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf

Example

Loadingā€¦

Array.prototype.join

No mutation

Description

The join() method joins all elements of an array into a string.

Array.prototype.join (separator)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join

Example

Loadingā€¦

Array.prototype.keys()

No mutation

Description

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

arr.keys()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys

Example

Loadingā€¦

Array.prototype.lastIndexOf

No mutation

Description

The lastIndexOf() method returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.

Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf

Example

Loadingā€¦

Array.prototype.map

No mutation

Description

The map() method creates a new array with the results of calling a provided function on every element in this array.

Array.prototype.map ( callbackfn [ , thisArg ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map

Example

Loadingā€¦

Array.prototype.pop

Mutates

Description

The pop() method removes the last element from an array and returns that element. This method changes the length of the array.

Array.prototype.pop ( )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop

Example

Loadingā€¦

Array.prototype.push

Mutates

Description

The push() method adds one or more elements to the end of an array and returns the new length of the array.

Array.prototype.push ( [ item1 [ , item2 [ , ā€¦ ] ] ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push

Example

Loadingā€¦

Array.prototype.reduce

No mutation

Description

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

Array.prototype.reduce ( callbackfn [ , initialValue ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce

Example

Loadingā€¦

Array.prototype.reduceRight

No mutation

Description

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

Array.prototype.reduceRight ( callbackfn [ , initialValue ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight

Example

Loadingā€¦

Array.prototype.reverse

Mutates

Description

The reverse() method reverses an array in place. The first array element becomes the last, and the last array element becomes the first.

Array.prototype.reverse ( )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse

Example

Loadingā€¦

Array.prototype.shift

Mutates

Description

The shift() method removes the first element from an array and returns that element. This method changes the length of the array.

Array.prototype.shift ( )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift

Example

Loadingā€¦

Array.prototype.slice

No mutation

Description

The slice() method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included). The original array will not be modified.

Array.prototype.slice (start, end)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice

Example

Loadingā€¦

Array.prototype.some

No mutation

Description

The some() method tests whether some element in the array passes the test implemented by the provided function.

Array.prototype.some ( callbackfn [ , thisArg ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some

Example

Loadingā€¦

Array.prototype.sort

Mutates

Description

The sort() method sorts the elements of an array in place and returns the array. The sort is not necessarily stable. The default sort order is according to string Unicode code points.

Array.prototype.sort (comparefn)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

Example

Loadingā€¦

Array.prototype.splice

Mutates

Description

The splice() method changes the content of an array by removing existing elements and/or adding new elements.

Array.prototype.splice (start, deleteCount [ , item1 [ , item2 [ , ā€¦ ] ] ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice

Example

Loadingā€¦

Array.prototype.toLocaleString

No mutation

Description

The toLocaleString() method returns a string representing the elements of the array. The elements are converted to Strings using their toLocaleString methods and these Strings are separated by a locale-specific String (such as a comma ā€œ,ā€).

Array.prototype.toLocaleString ( )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString

Example

Loadingā€¦

Array.prototype.toSource()

No mutation

Description

The toSource() method returns a string representing the source code of the array.

arr.toSource()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSource

Example

Loadingā€¦

Array.prototype.toString

No mutation

Description

The toString() method returns a string representing the specified array and its elements.

Array.prototype.toString ( )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString

Example

Loadingā€¦

Array.prototype.unshift

Mutates

Description

The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.

Array.prototype.unshift ( [ item1 [ , item2 [ , ā€¦ ] ] ] )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift

Example

Loadingā€¦

Array.prototype.values()

No mutation

Description

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

arr.values()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values

Example

Loadingā€¦