Why setTimeout with 0ms delay considered asynchronous?
Also why after await the rest of code in async function is moved to microtask queue?
console.log(
new Promise((res,rej)=>{res(2)}).then(a=>{console.log(a)})
)
why does this code output Promise pending first
New contributor
anant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1