Région de recherche :

Date :

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

Promise.resolve() - JavaScript | MDN - MDN Web Docs

The Promise.resolve() static method "resolves" a given value to a Promise. If the value is a promise, that promise is returned; if the value is a thenable, Promise.resolve() will call the then() method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value.

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

Promise - JavaScript | MDN - MDN Web Docs

Les 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. La méthode .then() prend deux arguments : le premier est une fonction de rappel ( callback ) pour le cas de résolution de la promesse et le second argument est une ...

https://www.freecodecamp.org › news › javascript-promise-tutorial-how-to-resolve-or-reject...

JavaScript Promise Tutorial – How to Resolve or Reject Promises in JS

Output the fastest promise that got resolved: The Promise.resolve/reject methods. Promise.resolve(value) – It resolves a promise with the value passed to it. It is the same as the following: let promise = new Promise (resolve => resolve(value));

JavaScript Promise Tutorial – How to Resolve or Reject Promises in JS

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

JavaScript Promise.resolve() Method - W3Schools

Description. The Promise.resolve() method returns a Promise object resolved with a value. Syntax. Promise.resolve (message) Parameters. Return Value. Promise Tutorial. catch () finally () then () Browser Support. Promise.Resolve() is an ECMAScript6 (ES6) feature. ES6 (JavaScript 2015) is supported in all modern browsers since June 2017:

https://masteringjs.io › tutorials › fundamentals › promise-resolve

Resolve a Promise in JavaScript - Mastering JS

The Promise.resolve() function is the most concise way to create a fulfilled promise that contains the given value. For example, suppose you wanted to create a promise that is fulfilled with the string 'Hello, World': const p = Promise.resolve('Hello, World'); const str = await p;

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

JavaScript - Promise.resolve [fr] - Runebook.dev

Le Promise.resolve() static méthode "resolves" une valeur donnée à un Promise. Si la valeur est un promise , ce promise est renvoyé ; si la valeur est un thenable, Promise.resolve() appellera la méthode then() avec deux rappels préparés ; sinon le promise retourné sera rempli avec la valeur.

https://www.freecodecamp.org › news › javascript-es6-promises-for-beginners-resolve-reject...

JavaScript Promise Tutorial: Resolve, Reject, and Chaining in JS and ES6

When we define a promise in JavaScript, it will be resolved when the time comes, or it will get rejected. Promises in JavaScript. First of all, a Promise is an object. There are 3 states of the Promise object: Pending: Initial State, before the Promise succeeds or fails. Resolved: Completed Promise. Rejected: Failed Promise.

JavaScript Promise Tutorial: Resolve, Reject, and Chaining in JS and ES6

https://javascript.info › promise-basics

Promise - The Modern JavaScript Tutorial

The first argument of .then is a function that runs when the promise is resolved and receives the result. The second argument of .then is a function that runs when the promise is rejected and receives the error. For instance, here’s a reaction to a successfully resolved promise: