Skip to content

Instantly share code, notes, and snippets.

@Mefistophell
Created October 26, 2024 15:56
Show Gist options
  • Save Mefistophell/34c33dccf7249c8625224ead10f4a56d to your computer and use it in GitHub Desktop.
Save Mefistophell/34c33dccf7249c8625224ead10f4a56d to your computer and use it in GitHub Desktop.
What will the log look like?
const promise = new Promise((resolve, reject) => {
console.log(1);
setTimeout(() => {
console.log("timerStart");
resolve("success");
console.log("timerEnd");
}, 0);
console.log(2);
});
promise.then((res) => {
console.log(7);
console.log(res);
});
console.log(4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment