Région de recherche :

Date :

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

JavaScript Promises - W3Schools

JavaScript Promise Examples. To demonstrate the use of promises, we will use the callback examples from the previous chapter: Waiting for a Timeout; Waiting for a File

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

Promise - JavaScript | MDN - MDN Web Docs

Promises in JavaScript represent processes that are already happening, which can be chained with callback functions. If you are looking to lazily evaluate an expression, consider using a function with no arguments e.g. f = => expression to create the lazily-evaluated expression, and f() to evaluate the expression immediately.

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 ...

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

Utiliser les promesses - JavaScript | MDN - MDN Web Docs

Une 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 › fr › docs › Web › JavaScript › Reference › Global_Objects › Promise

Promise - JavaScript | MDN - MDN Web Docs

La fonction tetheredGetNumber() illustre un générateur de promesse qui utilise reject() lors d'un appel asynchrone ou dans la fonction de rappel (ou dans les deux). La fonction promiseGetWord() illustre comment une fonction d'API peut générer et renvoyer une promesse de façon autonome.

https://www.aleksandrhovhannisyan.com › blog › javascript-promise-tricks

JavaScript Promises: Practical Use Cases and Examples

Promises are a powerful tool for writing asynchronous code in JavaScript. Here are a few interesting use cases.

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

JavaScript Promises: A Tutorial With Examples - Toptal

We’ll learn the basic vocabulary, and work through a few JavaScript promises examples to introduce the concepts behind them in a practical way. I’ll use one of the more popular implementation libraries, rsvp.js , in the code examples.

JavaScript Promises: A Tutorial With Examples - Toptal

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”. Le “producteur de code” prend le temps nécessaire pour produire le résultat promis, et la “promesse” donne le résultat ...

https://www.javascripttutorial.net › es6 › javascript-promises

JavaScript Promises - JavaScript Tutorial

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' },

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.