https://javascript.info › promise-basics
Promise - The Modern JavaScript TutorialA 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”. The “producing code” takes whatever time it needs to produce the promised result, and the “promise” makes that result available to all of the ...
Його аргументи resolve і reject – це колбеки які надає нам сам JavaScript. Наш код – тільки всередині виконавця. Коли функція-виконавець завершить свою роботу, неважливо – зараз чи пізніше, вона повинна викликати один з цих ...
promise callback; promise 允许我们按照自然顺序进行编码。首先,我们运行 loadScript,之后,用 .then 来处理结果。: 在调用 loadScript(script, callback) 时,我们必须有一个 callback 函数可供使用。 换句话说,在调用 loadScript 之前,我们必须知道如何处理结果。: 我们可以根据需要,在 promise 上多次调用 .then。
https://www.digitalocean.com › community › tutorials › understanding-javascript-promises
Understanding JavaScript Promises - DigitalOceanUnderstanding Promises. A Promise in short: “Imagine you are a kid. Your mom promises you that she’ll get you a new phone next week.” You don’t know if you will get that phone until next week. Your mom can really buy you a brand new phone, or she doesn’t. That is a promise. A promise has three states. They are:
Learn how to use the Promise object to handle asynchronous operations in JavaScript. A Promise represents the eventual completion or failure of an asynchronous action and its resulting value.
https://www.freecodecamp.org › news › guide-to-javascript-promises
How Promises Work in JavaScript – A Comprehensive Beginner's GuideThis article is an in-depth guide to promises in JavaScript. You are going to learn why JavaScript has promises, what a promise is, and how to work with it. You are also going to learn how to use async/await—a feature derived from promises—and what a job queue is. Here are the topics we will cover: Why should you care about promises?
https://developer.mozilla.org › fr › docs › Web › JavaScript › Guide › Using_promises
Utiliser les promesses - JavaScript | MDN - MDN Web DocsUne promesse est un objet (Promise) qui représente la complétion ou l'échec d'une opération asynchrone. La plupart du temps, on « consomme » des promesses et c'est donc ce que nous verrons dans la première partie de ce guide pour ensuite expliquer comment les créer.
https://developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Using_promises
Using promises - JavaScript | MDN - MDN Web DocsA 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.
https://www.freecodecamp.org › news › javascript-promise-object-explained
How JavaScript Promises Work – Tutorial for BeginnersLearn how to use the Promise object to handle asynchronous operations in JavaScript. See examples of how to create, resolve, reject, and chain promises, and how to use the fetch API and other methods with promises.
https://dev.to › alexmercedcoder › understanding-javascript-promises-in-depth-5ga9
Understanding JavaScript Promises In-Depth - DEV CommunityLearn how to create, use, and handle promises in JavaScript, a powerful abstraction for managing asynchronous operations. Explore advanced features, real-world use cases, and best practices for promises and async/await.
https://dev.to › shriharimurali › javascript-promises-from-beginner-to-expert-a...
JavaScript Promises: From Beginner to Expert - DEV CommunityPromises are a powerful tool in JavaScript that help manage asynchronous operations and provide a more readable and maintainable codebase. In this tutorial, we will take you from a beginner's level to an expert level, covering all the important aspects of JavaScript promises.
https://www.freecodecamp.org › news › javascript-promises-async-await-and-promise-methods
How to Use JavaScript Promises – Callbacks, Async/Await, and Promise ...Promises are one of the most important parts of JavaScript – but they can be confusing and difficult to understand. Many new devs, as well as experienced ones, struggle to fully grasp them. So what is a promise? A promise represents an asynchronous operation whose result will come in the future.