0

If I have the following code in ES6, where "then" handlers don't return new promise, will both "then" handlers be called synchronously or each new "then" handler is called asynchronously one after another?

Promise.resolve()
  .then(() => {console.log(1)})
  .then(() => {console.log(2)})
Vincente
  • 341
  • 3
  • 13
  • 1
    There is good [documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on this if you scroll down to the section titled "Chaining" where it states: When a value is simply returned from within a then handler, it will effectively return `Promise.resolve()` – Mark C. Oct 15 '19 at 14:45
  • Thank you, so the simple answer is: **"then" handlers are called asynchronously.** – Vincente Oct 15 '19 at 15:26

0 Answers0