Promise.then
then — A callback for a resolved Promise. Will execute as soon as the promise is resolved. If the promise is already resolved, it will execute instantly.
Description
Promise.then([mixed result])
Parameters
Name | Description | Type | Default | Optional |
---|---|---|---|---|
result | The result from the resolve function in the promise. | mixed | Yes |
Changelog
Version | Description |
---|---|
ES 6 | Introduced. |
Examples
Example #1 – Nested example
Example #2 – Hook example
Example #3 – Resolve after 1 second.
Example #4 – Bind hook 1 second after the promise has already been resolved