Exam-style question
Try this first
Which description best matches a higher-order function?.
- A.A function that always returns a number
- B.A function that takes a function as an argument or returns a function as a result
- C.A function that contains no repetition
- D.A function that can only process lists of strings
Model answer
What a good answer should say
- A function that takes a function as an argument or returns a function as a result.
Explanation
Why this works
The specification defines a higher-order function as one that takes a function as an argument, returns a function as a result, or does both.
Common mistake
No common mistake is linked to this question yet.
