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 happend:
- 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: