SNSrekaravarshan N Kinsrekaravarshan.hashnode.dev·Jul 11 · 23 min readPart 7: Closing the LoopWhat no one teaches you about the JavaScript Event Loop — Part 7 of 8 A puzzle that exposes await async function f() { console.log('A'); await Promise.resolve(); console.log('B'); awa00
SNSrekaravarshan N Kinsrekaravarshan.hashnode.dev·Jul 11 · 28 min readPart 6: Microtasks and Why Two QueuesWhat no one teaches you about the JavaScript Event Loop — Part 6 of 8 A puzzle, slightly harder Promise.resolve().then(() => { console.log('1'); Promise.resolve().then(() => console.log('2'))00
SNSrekaravarshan N Kinsrekaravarshan.hashnode.dev·Jul 11 · 27 min readPart 5: The Event Loop, MechanicallyWhat no one teaches you about the JavaScript Event Loop — Part 5 of 8 A puzzle, with the answer on the line console.log('1'); setTimeout(() => console.log('2'), 0); Promise.resolve().then(() => conso00
SNSrekaravarshan N Kinsrekaravarshan.hashnode.dev·Jun 17 · 29 min readPart 4: Where JavaScript Actually RunsWhat no one teaches you about the JavaScript Event Loop — Part 4 of 8 A puzzle in DevTools Open any page in your browser. Open DevTools. Click the Performance tab. Hit the record button (the circle).00
SNSrekaravarshan N Kinsrekaravarshan.hashnode.dev·Jun 17 · 37 min readPart 3: Where Threads SleepWhat no one teaches you about the JavaScript Event Loop — Part 3 of 8 A different puzzle In Part 2 we left a question hanging. An idle browser tab uses zero CPU. Open your task manager — a tab with n00