Région de recherche :

Date :

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://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://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://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 › en-US › docs › Web › JavaScript › Reference › Global_Objects › Promise

Promise - JavaScript | MDN - MDN Web Docs

The promise methods then(), catch(), and finally() are used to associate further action with a promise that becomes settled. The then() method takes up to two arguments; the first argument is a callback function for the fulfilled case of the promise, and the second argument is a callback function for the rejected case.

https://runebook.dev › fr › docs › javascript › global_objects › promise › then

JavaScript - promise.then [fr] - Runebook.dev

La méthode then() des instances Promise prend jusqu'à deux arguments : des fonctions de rappel pour les cas remplis et rejetés du Promise. Il renvoie immédiatement un objet Promise équivalent, vous permettant d'appeler chain vers d'autres méthodes promise .

https://developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Using_promises

Using promises - JavaScript | MDN - MDN Web Docs

Here's the magic: the then() function returns a new promise, different from the original: js. const promise = doSomething(); const promise2 = promise.then(successCallback, failureCallback);

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.

https://javascript.info › promise-chaining

Promises chaining - The Modern JavaScript Tutorial

JavaScript checks the object returned by the .then handler in line (*): if it has a callable method named then, then it calls that method providing native functions resolve, reject as arguments (similar to an executor) and waits until one of them is called.