Functional programming Flashcards
1
Q
What is a higher order function?
A
A function that takes a function as an argument or returns a function as a result, or does both
2
Q
What does the map function do?
A
Applies a function to every item on the list and returns as a list
3
Q
What does the filter function do?
A
Applies a condition to every item on the list and returns a list of items that meet the condition
4
Q
What does the fold/reduce function do?
A
Applies a ‘combining function’ to a list continually until the list is reduced to a single value