Yahoo Web Search

Search results

  1. Oct 7, 2024 · The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value. To learn about the way promises work and how you can use them, we advise you to read Using promises first.

  2. A JavaScript Promise object can be: The Promise object supports two properties: state and result. While a Promise object is "pending" (working), the result is undefined. When a Promise object is "fulfilled", the result is a value. When a Promise object is "rejected", the result is an error object.

  3. Oct 7, 2024 · A Promise is an object representing the eventual completion or failure of an asynchronous operation. Since most people are consumers of already-created promises, this guide will explain consumption of returned promises before explaining how to create them.

  4. Nov 29, 2023 · Basically, a Promise object represents apending state” in the most common sense: the promise will eventually be fulfilled at a later date. To give you an illustration, suppose you want to buy a new phone to replace your old phone, so you open a messaging app to contact a phone store.

  5. Jun 23, 2024 · A promise is a special JavaScript object that links the “producing code” and the “consuming code” together. In terms of our analogy: this is the “subscription list”.

  6. Jul 25, 2024 · A promise is an object returned by an asynchronous function, which represents the current state of the operation. At the time the promise is returned to the caller, the operation often isn't finished, but the promise object provides methods to handle the eventual success or failure of the operation.

  7. People also ask

  8. JavaScript Promises. Summary: in this tutorial, you will learn about JavaScript promises and how to use them effectively. Why JavaScript promises. The following example defines a function getUsers() that returns a list of user objects: function getUsers() { return [ { username: 'john', email: 'john@test.com' },

  1. People also search for