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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Array.prototype.map useful for?

A

Getting a new array with each item being manipulated by an expression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly