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 - W3SchoolsThe 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 › ... › Web › JavaScript › Reference › Global_Objects › Promise › then
Promise.prototype.then () - JavaScript | MDN - MDN Web DocsLearn how to use the then() method of Promise instances to handle the fulfillment or rejection of a promise. See syntax, parameters, return value, examples, and subclassing of then() method.
https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Global_Objects › Promise
Promise - JavaScript | MDNLes méthodes promise.then(), promise.catch(), et promise.finally() sont utilisées pour associer une action ultérieure à une promesse lorsque celle-ci devient acquittée.
https://www.w3schools.com › Js › js_promise.asp
JavaScript Promises - W3SchoolsLearn how to use JavaScript Promises to handle asynchronous code with then() method. See examples of promises for timeouts, files, and errors.
https://masteringjs.io › tutorials › fundamentals › then
The Promise then() Function in JavaScript - Mastering JSLearn how to use the then() function to handle the success or failure of an asynchronous operation with promises. See examples of chaining, error handling, and the difference between then() and catch().
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://runebook.dev › fr › docs › javascript › global_objects › promise › then
JavaScript - promise.then - Runebook.devLa 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://javascript.info › promise-chaining
Promises chaining - The Modern JavaScript TutorialJavaScript 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.
https://javascript.info › promise-basics
Promise - The Modern JavaScript TutorialThe most important, fundamental one is .then. The syntax is: promise.then ( function (result) { /* handle a successful result */ }, function (error) { /* handle an error */ } ); The first argument of .then is a function that runs when the promise is resolved and receives the result.