ES6 Map, Filter, Reduce Flashcards

1
Q

array.map( )

A

Receives a function as a parameter (a callback function). The callback function is getting executed on each element of the array, one by one.

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

array.filter( )

A

returns a new array, if the callback function returns true, the current element will be in the resulting array. If it returns false, it won’t be.

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

array.reduce( )

A

generates a single value or object from an array. the two parameters used in the callback function are respectively the so called accumulator and the current element.

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