array-higher-order-functions Flashcards
1
Q
What is Array.prototype.filter useful for?
A
Getting a new array with less items then before based on a condition.
2
Q
What is Array.prototype.map useful for?
A
Getting a new array with each item being manipulated by an expression.
3
Q
What is Array.prototype.reduce useful for?
A
Getting a single value from an array of items by having an accumulator variable changing value with each iteration as it is manipulated by an expression that has the current item in an array starting at the beginning and going to the end.