I know we all use promises to avoid function callback hell, but my question is where in the event loop the promise code runs and whether the code is really asynchronous.
I mean, is this code asynchronous just because it's run within a promise? Or is the promise not a part of the event loop?
const p = new Promise((resolve,reject) =>{
resolve('am i part of the event loop ? , am i a diffrent thread ? or am i synchronized? ')
})
See Question&Answers more detail:os