Skip to content
Latchkey

What Is a Higher-Order Function?

A higher-order function is one that operates on other functions, either by accepting them as parameters, returning them as results, or both. It relies on functions being first-class values that can be passed around like any other data. Common examples include map, filter, and reduce, which take a function describing the per-element work.

Why it matters

Higher-order functions let you abstract over behavior, not just values, which removes repetitive control-flow boilerplate. They are the core mechanism behind composable functional and callback-based APIs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →