Callback
Definition
A function passed as an argument to another function, to be executed later. Callbacks are the foundation of asynchronous JavaScript and are used extensively in event handling and array methods.
Code Example
Learn More
Related Terms
An object representing the eventual completion or failure of an asynchronous operation. A Promise is in one of three states: pending, fulfilled, or rejected. Promises can be chained with .then() and .catch().
Async/AwaitSyntactic sugar built on top of Promises that makes asynchronous code look and behave like synchronous code. async functions always return a Promise, and await pauses execution until a Promise resolves.
Higher-Order FunctionA function that either takes one or more functions as arguments, returns a function, or both. Common examples include map, filter, reduce, and forEach.