Methods

MethodMutatesDescription
concatno 
copyWithinmutates 
every  
fillmutates 
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
popmutatesremoves and displays the last item from the end
pushmutatesadds 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  
reversemutatesreverse the order of the items
shiftmutatesremove an item from the beginning of an array
slice remove and displays part of the array
some  
sortmutatesalphabetically sort items.
splicemutatesmodifies an array by removing existing elements and/or adding new elements.
split  
unshiftmutatesadds an item to the beginning of an array, and returns the new length

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext