1/9
Flashcards on Array Methods, Spread and Rest Operators and Destructuring
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
forEach
Executes a provided function once for each array element.
map
Creates a new array with the results of calling a provided function on every element in the calling array.
The map method does not alter the original array; it applies a function to each element and returns a new array with transformed elements. This is useful for transforming data in arrays.
filter
Creates a new array with all elements that pass the test implemented by the provided function.
some
Tests whether at least one element in the array passes the test implemented by the provided function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false.
every
Tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value.
reduce
Executes a reducer function (that you provide) on each element of the array, resulting in single output value.
Spread Operator
Expands an iterable (like an array) into multiple values.
Rest Operator
Allows a function to accept an indefinite number of arguments as an array.
Destructuring
A way to extract multiple values from data stored in arrays and objects and assign them to variables.
mergeObjects
function that accepts two objects and returns a new object which contains all the keys and values of the first object and second object.