Promise
Definition
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()`.
Code Example
Learn More
Related Terms
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.
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.
Event LoopThe mechanism that allows JavaScript to perform non-blocking operations despite being single-threaded. It continuously checks if the call stack is empty, then moves tasks from the callback queue to the call stack for execution.