Skip to content
RED SAG Skills
mediumStudy question · answer published in Node.js interview questions, so no pointsstacks-and-queuesjavascript

Promise callback versus setTimeout order

In Node.js or a browser, what does this code print?

console.log(1)
setTimeout(() => console.log(2), 0)
Promise.resolve().then(() => console.log(3))
console.log(4)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions