Skip to content
RED SAG Skills
hardStudy question · answer published in JavaScript interview questions, so no pointsjavascriptevent-loopnodejs

setImmediate inside an I/O callback

In Node.js, what is the order inside a file read callback?

fs.readFile("a.txt", () => {
  setTimeout(() => console.log("timeout"), 0)
  setImmediate(() => console.log("immediate"))
})
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions