M3-JavaScript Flashcards

1
Q

What is Array.prototype.filter useful for?

A

It creates a new array with the elements that pass the provided function.

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

What is a higher-order function?

A

A higher-order function is a function that takes a function as an argument or returns a function

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

What is Array.prototype.map useful for?

A

It creates a new array populated with the results of calling a provided function on every element in the calling array.

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

What is Array.prototype.reduce useful for?

A

The reduce() is to return the sum of all the elements in an array.

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