Promise resolve() method:
Promise.resolve() method in JS returns a Promise object that is resolved with a given value. Any of the three things can happened:
- If the value is a promise then promise is returned.
- If the value has a “then” attached to the promise, then the returned promise will follow that “then” to till the final state.
- The promise fulfilled with its value will be returned.
Value to be resolved by this Promise.
Either the promise of the promise fulfilled with its value is returned.
Resolving an array:
Resolving another Promise:
- Google Chrome 6.0 and above
- Internet Explorer 9.0 and above
- Mozilla 4.0 and above
- Opera 11.1 and above
- Safari 5.0 and above