Tutti Nuovi

user:thomas utente che ha creato il gist

title:mygist titolo del gist

filename:myfile.txt nome di file nel gist

extension:yml estensione del file nel gist

language:go linguaggio del file nel gist

topic:homelab gists with given topic

Registrati

Entra


Tutti Nuovi Registrati Entra

linkjobai

Unito 5 days ago

Più recente creazione
Meno recente creazione
Più recente aggiornamento
Meno recente aggiornamento
Tutti i gists 1

linkjobai / Explaining the JavaScript Event Loop in Interviews

0 mi piace
0 forks
1 files
Ultima volta attivo 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');
Più nuovi Più vecchi

Creato da Opengist ⋅ Load: 47ms⋅

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