Array Methods Flashcards
Concat()
Combines existing arrays and creates a new one
Constructor()
Returns the function that created the array prototype
displays pseudocode
copyWithin()
copies array elements to another position in the array,
method overwrites the existing values,
does not add items to the array.
(doubles elements in the array)
entries()
The entries() method returns an Array Iterator object with key/value pairs:
[0, “Banana”]
[1, “Orange”]
[2, “Apple”]
[3, “Mango”]
The entries() method does not change the original array.
every()
executes a function for each array element.
returns a Boolean
does not change the original array
(checks to see if every methods meets the given parameters)
fill()
Replaces values in the array with given parameters
filter()
creates a new array filled with elements that pass a test provided by a function.
find()
Returns the value of the first element that meets the given parameters
executes for each element in the array
returns undefines if nothing meets the given parameters
findIndex()
returns the z-index of the array element that meets the requirement
executes for each element in the array
returns -1 if nothing meets the given parameters
forEach
calls a function for each element in an array