Array API Flashcards
Memorizing most useful Array methods on JavaScript
Returns a new array comprised of this array joined with other array(s) and/or value(s).
array.concat(value1, value2, …, valueN)
Tests whether all elements in the array pass the test implemented by the provided function.
array.every(callback[, thisObject])
Creates a new array with all elements that pass the test implemented by the provided function.
array.filter(callback[, thisObject])
Executes a provided function once per array element.
array.forEach(callback[, thisArg])
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
array.indexOf(searchElement[, fromIndex])
Joins all elements of an array into a string.
array.join(separator)
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.lastIndexOf(searchElement[, fromIndex])
Creates a new array with the results of calling a provided function on every element in this array.
array.map(callback[, thisArg])
Removes the last element from an array and returns that element.
array.pop()
Mutates an array by appending the given elements and returning the new length of the array.
array.push(element1, …, elementN)
Reverses an array in place. The first array element becomes the last and the last becomes the first.
array.reverse()
Removes the first element from an array and returns that element. This method changes the length of the array.
array.shift()
Returns a one-level deep copy of a portion of an array.
array.slice(begin[, end])
Sorts the elements of an array in place and returns the array.
array.sort([compareFunction])
Changes the content of an array, adding new elements while removing old elements.
array.splice(index , howMany[, element1[, …[, elementN]]]) array.splice(index[, howMany[, element1[, …[, elementN]]]])