Functions

Callback function

Try the free JavaScript compiler

A callback is a supplied callable invoked according to another operation’s contract. It may run synchronously, asynchronously, once, repeatedly or not at all. Its expected arguments and result depend on the receiving operation.

Formal Syntax & Structure

javascript syntaxjavascript
operation(callback)

Working Example

Example Snippetjavascript
function run(f){return f(5);}console.log(run(n=>n*3));
JavaScript Reference