Chapter 1.1 | JavaScript Execution Context: GEC, FEC, and the Reality of Hoisting

Опубликовано: 14 Май 2026
на канале: Web Fundamentals
56
4

"To understand a system, you must understand its constituent parts." — Charlie Munger

Most developers treat "Hoisting" as a magical trick where JavaScript moves code to the top of the file. But in engineering, magic is just a lack of understanding. In this chapter, we deconstruct this myth by looking at the fundamental building block of the JS Engine: the Execution Context.

We will explore why your code behaves the way it does before a single line is even executed. By understanding the "workstation" the engine builds for your code, you’ll stop guessing and start predicting how JavaScript handles memory, functions, and variables.

🧠 What you will learn:
The Hoisting Myth: Why it’s not about moving code, but about memory allocation.

The Two Phases: A deep dive into the Creation Phase and the Execution Phase.

Workstation Setup: How the Global Execution Context (GEC) initializes the Global Object and the this keyword.

Function Mechanics: What happens on the Call Stack when a function is invoked and how its local environment is born.

The Foundation for Seniority: Building a mental model that makes debugging intuitive rather than accidental.


🛠️ Part of the "Evergreen JS" Series
This channel is dedicated to building a deep, fundamental understanding of software engineering. We don't focus on short-term trends; we focus on the mental models that will be valid 10-15 years from now.

Next Chapter: 1.2 The Modern World: Let, Const, and the Temporal Dead Zone.

#JavaScript #WebDev #SoftwareEngineering #MentalModels #Programming #Hoisting #ExecutionContext #JuniorToSenior #Local Variable Environment #Global Variable Environment