Todos Novo

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Registrar-se

Entrar


Todos Novo Registrar-se Entrar

linkjobai

Juntou-se 5 days ago

Mais recente criado
Menos recente criado
Mais recente atualizado
Menos recente atualizado
Todos os gists 1

linkjobai / Explaining the JavaScript Event Loop in Interviews

0 curtidas
0 bifurcações
1 arquivos
Última atividade 5 days ago
Explaining the JavaScript Event Loop in Interviews
career 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');
Próximo Anterior

Desenvolvido por Opengist ⋅ Load: 30ms⋅

Português
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文