array Flashcards

1
Q

What does Array.filter do?

A

it does not change the array so needs to be assigned to a variable

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

What should the callback function return?

A

returns a boolean value if true returns a copy

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

What is Array.filter useful for?

A

to filter out unwanted arrays

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

What does Array.map do?

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

What should the callback function return?

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

What is Array.map useful for?

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

What does Array.reduce do?

A

walks through an array and reduces it down to a single value

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

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

What should the callback function return?

A

it returns the accumulated value

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

What is Array.reduce useful for?

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