This commit is contained in:
Ilya Kantor 2019-09-21 22:29:38 +03:00
parent 75577f94a4
commit c3ef6c07eb

View file

@ -267,7 +267,7 @@ It's not exactly an alias of `then(f,f)` though. There are several important dif
If a promise is pending, `.then/catch/finally` handlers wait for it. Otherwise, if a promise has already settled, they execute immediately:
```js run
// an immediately resolved promise
// the promise becomes resolved immediately upon creation
let promise = new Promise(resolve => resolve("done!"));
promise.then(alert); // done! (shows up right now)