Région de recherche :

Date :

https://www.w3schools.com › Js › js_promise.asp

JavaScript Promises - W3Schools

Promise How To. Here is how to use a Promise: myPromise.then ( function (value) { /* code if successful */ }, function (error) { /* code if some error */ } ); Promise.then () takes two arguments, a callback for success and another for failure.

https://developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Promise

Promise - JavaScript | MDN - MDN Web Docs

Description. A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason.

https://javascript.info › promise-basics

Promise - The Modern JavaScript Tutorial

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”. The “producing code” takes whatever time it needs to produce the promised result, and the “promise” makes that result available to all of the subscribed code ...

https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Global_Objects › Promise

Promise - JavaScript | MDN - MDN Web Docs

L'objet Promise (pour « promesse ») est utilisé pour réaliser des traitements de façon asynchrone. Une promesse représente une valeur qui peut être disponible maintenant, dans le futur voire jamais.

https://developer.mozilla.org › fr › docs › Web › JavaScript › Guide › Using_promises

Utiliser les promesses - JavaScript | MDN - MDN Web Docs

Promise.resolve() et Promise.reject() sont des méthodes qui permettent de créer des promesses déjà tenues ou rompues. Promise.all() et Promise.race() sont deux outils de composition qui permettent de mener des opérations asynchrones en parallèle.

https://fr.javascript.info › promise-basics

Promesse (promise) - JavaScript

Une promesse (promise) est un objet spécial en JavaScript qui lie le “producteur de code” et le “consommateur de code” ensemble. En comparant à notre analogie c’est la “liste d’abonnement”.

https://www.toptal.com › javascript › javascript-promises

JavaScript Promises: A Tutorial With Examples - Toptal

What is a JavaScript promise? A promise is a method that eventually produces a value. It can be considered as the asynchronous counterpart of a getter function. Its essence can be explained as: promise.then(function(value) { // Do something with the 'value' });

JavaScript Promises: A Tutorial With Examples - Toptal

https://javascript.info › promise-api

Promise API - The Modern JavaScript Tutorial

The JavaScript language. Promises, async/await. February 20, 2022. Promise API. There are 6 static methods in the Promise class. We’ll quickly cover their use cases here. Promise.all. Let’s say we want many promises to execute in parallel and wait until all of them are ready.

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.

How to Use JavaScript Promises – Callbacks, Async/Await, and Promise ...

https://web.dev › articles › promises

JavaScript Promises: an introduction | Articles - web.dev

JavaScript Promises: an introduction. bookmark_border. Promises simplify deferred and asynchronous computations. A promise represents an operation that hasn't completed yet. Jake Archibald. Developers, prepare yourself for a pivotal moment in the history of web development. [Drumroll begins] Promises have arrived in JavaScript!