0

enter image description here

Can somebody tell me why the two outputs are different under the console? And why is the second Promise state pending but its [[PromiseState]] state is fulfilled?

  • 1
    because the console evaluates when you inspect the object - hover over the blue `i` information icon and your browser will tell you exactly that – Jaromanda X Feb 08 '21 at 08:14
  • Because by chaining `.then()` you are returning a fulfilled Promise. – Terry Feb 08 '21 at 08:14
  • Welcome to Stack Overflow! Please take the [tour], have a look around, and read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) Please post code, error messages, markup, etc. **as text**, not as a *picture* of text. Why: http://meta.stackoverflow.com/q/285551/157247 – T.J. Crowder Feb 08 '21 at 08:15
  • @Terry - `.then()` doesn't always return a fulfilled promise, and won't in the OP's example code (because the microtask doing the first promise's reactions has run yet). – T.J. Crowder Feb 08 '21 at 08:17

0 Answers0