Level 12

new Promise runs now

Code inside new Promise(...) and code inside .then. Which one is async?

console.log('1');new Promise((resolve) => {  console.log('2');  resolve();}).then(() => console.log('4'));console.log('3');

1. Predict the output

Tap the lines in the order you think they print.

  1. 1…
  2. 2…
  3. 3…
  4. 4…