array Flashcards
1
Q
What does Array.filter do?
A
it does not change the array so needs to be assigned to a variable
2
Q
What should the callback function return?
A
returns a boolean value if true returns a copy
3
Q
What is Array.filter useful for?
A
to filter out unwanted arrays
4
Q
What does Array.map do?
A
5
Q
What should the callback function return?
A
6
Q
What is Array.map useful for?
A
7
Q
What does Array.reduce do?
A
walks through an array and reduces it down to a single value
8
Q
What action should the callback function perform?
A
exam the element do a calculation and add it to the accumulated value and updates it.
9
Q
What should the callback function return?
A
it returns the accumulated value
10
Q
What is Array.reduce useful for?
A