array-reduce Flashcards
1
Q
What does Array.reduce do?
A
Walks through an array and reduces it into a single value. Number or string
2
Q
What action should the callback function perform?
A
Examine the element, d computation on it and add it to the accumulated value. Updates the accumulated value depenedin on the current value
3
Q
What should the callback function return?
A
returns the accumulated value
4
Q
What is Array.reduce useful for?
A