jargon

Design patterns·Functional ideas that went mainstream

the function's argument is another function, and what it actually does depends entirely on what you passed.

Higher-order function

Also calledHOF, function taking a function

A function that takes or returns another function. It is the mechanism behind map, filter, sort comparators, decorators, middleware and retry helpers — anywhere the shape of a computation is fixed and one step of it is not. The pattern-catalogue equivalents are strategy and template method, both of which reduce to a higher-order function in a language with closures.

Commonly confused with