Région de recherche :

Date :

https://www.w3schools.com › jsref › jsref_promise_then.asp

JavaScript Promise then() Method - W3Schools

The then() method provides two callbacks: One funtion to run when a promise is fulfilled and one funtion to run when a promise is rejected.

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

Promise.prototype.then() - JavaScript | MDN - MDN Web Docs

La méthode then() renvoie un nouvel objet Promise, ce qui permet d'enchaîner les appels aux méthodes des promesses. Si la fonction passée à then() comme gestionnaire renvoie un objet Promise, une promesse équivalente sera exposée à l'appel à then() qui suit.

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

Promise.prototype.then() - JavaScript | MDN - MDN Web Docs

The then() method of Promise instances takes up to two arguments: callback functions for the fulfilled and rejected cases of the Promise. It stores the callbacks within the promise it is called on and immediately returns another Promise object, allowing you to chain calls to other promise methods.

https://stackoverflow.com › questions › 3884281

What does the function then () mean in JavaScript?

then() function is related to "Javascript promises" that are used in some libraries or frameworks like jQuery or AngularJS. A promise is a pattern for handling asynchronous operations. The promise allows you to call a method called "then" that lets you specify the function(s) to use as the callbacks.

https://masteringjs.io › tutorials › fundamentals › then

The Promise then() Function in JavaScript - Mastering JS

The `then()` function is the primary way you interact with promises in JavaScript, including promise chaining.

The Promise then() Function in JavaScript - Mastering JS

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

Utiliser les promesses - JavaScript | MDN - MDN Web Docs

La méthode then () renvoie une nouvelle promesse, différente de la première : js. const promise = faireQqc (); const promise2 = promise.then (successCallback, failureCallback); ou encore : js. const promise2 = faireQqc ().then (successCallback, failureCallback);

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

JavaScript Promises - W3Schools

Promise.then () takes two arguments, a callback for success and another for failure. Both are optional, so you can add a callback for success or failure only. Example.

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

Chaînage des promesses - JavaScript

Un gestionnaire, utilisé dans .then(handler) peut créer et renvoyer une promesse. Dans ce cas, les autres gestionnaires attendent que le problème soit réglé, puis le résultat est obtenu. Par exemple:

https://web.dev › articles › promises

JavaScript Promises: an introduction | Articles - web.dev

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

https://devdoc.net › ... › docs › Web › JavaScript › Reference › Global_Objects › Promise › then.html

Promise.prototype.then() - JavaScript | MDN - devdoc.net

The then() method returns a Promise. It takes up to two arguments: callback functions for the success and failure cases of the Promise. If one or both arguments are omitted, or are provided non-functions, then then will be missing the handler (s), but will not generate any errors.