Try/Catch
Definition
A 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.
Code Example
Javascript
Tip: Modify the code above and click “Run” to see the results
Learn More
Related Terms
Promise
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.