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 › 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://www.w3schools.com › jsref › jsref_promise_then.asp
JavaScript Promise then() Method - W3SchoolsLearn how to use the then() method to handle the fulfilled and rejected states of a promise in JavaScript. See the syntax, parameters, return value, description and browser support of then() method.
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://stackoverflow.com › questions › 3884281
What does the function then () mean in JavaScript?Each asynchronous task will return a promise object. Each promise object will have a then function that can take two arguments, a success handler and an error handler. The success or the error handler in the then function will be called only once, after the asynchronous task finishes.
https://developer.mozilla.org › fr › docs › Web › JavaScript › Guide › Using_promises
Utiliser les promesses - JavaScript | MDN - MDN Web DocsLa 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://masteringjs.io › tutorials › fundamentals › then
The Promise then() Function in JavaScript - Mastering JSLearn how to use the then() function to handle asynchronous operations with promises in JavaScript. See examples of then() with fulfilled, rejected, and chained promises, and how to use catch() as a shorthand for then().
https://fr.javascript.info › promise-basics
Promesse (promise) - JavaScriptthen (alors) Le plus important, le plus crucial est .then. La syntaxe est : promise.then( function(result) { /* gère un résultat correct */ }, function(error) { /* gère une erreur */ } ); Le premier argument de .then est une fonction qui se lance si la promesse est tenue, et reçoit le résultat.
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.
https://fr.javascript.info › promise-chaining
Chaînage des promesses - JavaScriptJavaScript vérifie l’objet retourné par le gestionnaire .then à la ligne (*): s il a une méthode appelable nommé then, il appelle cette méthode fournissant les fonctions natives resolve et reject comme arguments (semblable à un executeur) et attend que l’un d’eux soit appelé.