In your example there are 7 promises.
1) `p`
2) `Promise.resolve(console.log('A'))`
3) the promise returned by the first `then` call
4) `Promise.resolve(console.log('B'))`
5) the promise returned by the second `then` call
6) Promise.resolve(console.log('C'))
7) the promise returned by the third `then` call
They are settled in that order. Their reactions are triggered in different
turns. So, the console.log calls happen in different turns.
Even if there was a single promise with three reactions:
```
p.then(() => console.log('A'));
p.then(() => console.log('B'));
p.then(() => console.log('C'));
```
the reactions (the callbacks passed to the `then` method) would still be
triggered in different turns.
https://tc39.github.io/ecma262/#sec-triggerpromisereactions
As you can see in that link, the reactions are iterated and there's a
different job for each reaction.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss