Array Method 2s Pt Flashcards
from()
Create an array from any iterable object.
includes ()
Checks for specified value in an array, returns a boolean, case sensitive
indexOf()
returns the first index (position) of a specified value.
returns -1 if the value is not found.
starts at a specified index and searches from left to right.
isArray()
returns true if an object is an array, otherwise false
join()
returns an array as a string, does not change the original array.
keys()
returns an Array Iterator (loopable) object with the keys of an array
length
sets or returns the number of elements in an array.
lastIndexOf()
Returns the last index of a specified value
returns -1 if the value is not found.
starts at a specified index and searches from right to left.
map()
calls a function once for each element in an array and create a new array with the results
pop()
removes the last value of the array
changes the original array
returns the removed element
prototype
allows you to add new properties and methods to arrays.
push()
adds an element to the end of the array
reduce()
executes a reducer function for array element. (add & subtract)
returns a single value: the function’s accumulated result.
reduceRight()
executes a reducer function for each array element.
works from right to left.
returns a single value: the function’s accumulated result.
reverse()
reverses the order of the elements in an array.
overwrites the original array.