Async/Await
Definition
Syntactic 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.
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().
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.
Try/CatchA statement for handling runtime errors gracefully. Code in the try block is executed, and if it throws an error, execution jumps to the catch block. The finally block runs regardless of success or failure.