Methods
Method | Mutates | Description |
concat | no | |
copyWithin | mutates | |
every | ||
fill | mutates | |
filter | change size, not shape always returns an array the callback function must return True or False | |
find | change the shape to 1 returns the value of the first element that satisfies the provided testing function. does not return an array, returns the first instance, otherwise undefined | |
findIndex | ||
forEach | ||
from | ||
includes | ||
indexOf | ||
join | ||
lastIndexOf | ||
length | ||
map | change shape, not size, takes a callback function that takes one argument and applies the fn to each argument it will take each item and add it to an array always returns an array useful when you have an array of objects | |
pop | mutates | removes and displays the last item from the end |
push | mutates | adds an item to the end |
reduce | changes the shape and changes the size may or may not return an array executes a reducer function (that you provide) on each element of the array, resulting in single output value. | |
reduceRight | ||
reverse | mutates | reverse the order of the items |
shift | mutates | remove an item from the beginning of an array |
slice | remove and displays part of the array | |
some | ||
sort | mutates | alphabetically sort items. |
splice | mutates | modifies an array by removing existing elements and/or adding new elements. |
split | ||
unshift | mutates | adds an item to the beginning of an array, and returns the new length |
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext