Callback Function
Callback Function — A callback is a function passed as an argument to another function to be executed later, often after an asynchronous operation completes. Callbacks are the foundation of asynchronous JavaScript. They are used in event handlers, setTimeout, array methods (map, filter), and Node.js APIs. Callback hell (deeply nested callbacks) is a common problem solved by Promises and async/await. Always handle both success and error cases in callbacks. This term relates to the Function category of the reference. You will meet callback function in practice when working with APIs such as Function.prototype.call(), Function.prototype.apply(), Function.prototype.bind(), Function.prototype.toString(). Related terms: Closure, Hoisting, Event Loop, Prototype Chain, Temporal Dead Zone (TDZ), IIFE (Immediately Invoked Function Expression). Understanding callback function makes the rest of the JavaScript documentation noticeably easier to follow, because the concept recurs across methods, guides, and error messages. Look up more definitions in the JavaScript glossary.