linkjobai / Explaining the JavaScript Event Loop in Interviews
0 Kedvelések
0 forkok
1 fájlok
Utoljára aktív 5 days ago
Explaining the JavaScript Event Loop in Interviews
Explaining the JavaScript Event Loop in Interviews
A short, accurate answer:
JavaScript runs one call stack. When it's empty, the event loop first drains the microtask queue (resolved promises, queueMicrotask), then takes the next macrotask (timers, I/O, UI events).
So this logs A, D, C, B:
console.log('A');
Újabb
Régebbi