What is a function passed to another function as an argument called?

The story behind the answer

A function passed to another function as an argument is called a callback. The receiving function can invoke that callback immediately or save it to run later, allowing the caller to customize what happens next.

Callbacks are central to JavaScript because functions are first-class values: they can be stored in variables, passed as arguments, and returned from other functions. For example, an array method can receive a callback that processes each element, while an event listener can receive one that runs when a user clicks.

A callback is not automatically the same thing as a higher-order function. A callback is the function being passed; a higher-order function is the function that accepts or returns a function. A callback can also be a closure if it captures variables from its surrounding scope, but those terms describe different properties.

Callbacks may be synchronous, running before the receiving function returns, or asynchronous, running later after an event, timer, or network operation. Promises provide another way to organize asynchronous work, but a promise itself is not the name for the passed function.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: