<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Event-Loop on Commentary of Takao</title><link>https://takao.blog/en/tags/event-loop/</link><description>Recent content in Event-Loop on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Commentary of Takao</copyright><lastBuildDate>Sat, 13 Jun 2026 23:11:50 +0900</lastBuildDate><atom:link href="https://takao.blog/en/tags/event-loop/index.xml" rel="self" type="application/rss+xml"/><item><title>JavaScript Event Loop Deep Dive: Microtasks, Macrotasks, and Beyond</title><link>https://takao.blog/en/web/js-event-loop/</link><pubDate>Mon, 19 Feb 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/js-event-loop/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post JavaScript Event Loop Deep Dive: Microtasks, Macrotasks, and Beyond" /&gt;&lt;p&gt;The JavaScript event loop is one of the most important yet misunderstood concepts in the language. Despite JavaScript being single-threaded, its event loop enables non-blocking concurrency through a sophisticated queue system. This article builds a complete mental model of how JavaScript handles asynchronous execution, from the call stack to the microtask queue and everything in between.&lt;/p&gt;
&lt;h2 id="the-call-stack-and-execution-model"&gt;The Call Stack and Execution Model
&lt;/h2&gt;&lt;p&gt;JavaScript uses a call stack with a LIFO (Last In, First Out) structure. When a function is called, a new stack frame is pushed onto the stack. When the function returns, the frame is popped off. The key principle is run-to-completion: each function runs to completion before any other code can interrupt it.&lt;/p&gt;</description></item></channel></rss>