Array Methods Flashcards
concat()
Joins two or more arrays, and returns a copy of the joined arrays
every()
Tests whether all elements in the array pass the test implemented by the provided function
filter()
Creates a new array with all elements that pass the test implemented by the provided function
foreach()
Executes a provided function once per array element
indexOf()
Searches array for an element, and returns element’s position
join()
Joins all elements of an array into a string
lastIndexOf()
Searches array for an element, starting at the end, and returns element’s position
map()
Creates a new array with the results of calling a provided function on every element in this array
pop()
Removes last element of an array, and returns that element
push()
Adds new element to the end of an array, and returns the new length
reverse()
Reverses the order of elements in an array
shift()
Removes the first element of an array, and returns that element
slice()
Selects part of an array, and returns the new array
sort()
Sorts the elements of an array
splice()
Adds/Removes elements from an array
toString()
Converts an array to a string, and returns result
unShift()
Adds new elements to the beginning of an array, and returns the new length
valueOf()
Returns the primitive value of an array