0.2 — Where does JavaScript live?
You now know a program is a list of instructions. So you write some JavaScript… and then what? Where do you put it? What actually reads it?
The answer explains why JavaScript is everywhere — and it introduces the two “homes” you’ll work in for the rest of this journey: the browser and, later, Node.js.
Meet the browser — Chrome, Edge, Firefox, Safari. Here’s a thought that surprises people: the browser is itself a program that someone wrote. Its job is fetching web pages and showing them to you.
The deeper story, with the real names for things — this part is what turns “I saw it” into “I can explain it.”
What does an engine actually do with your file? Two big moves. First it parses the text — reads it, checks the grammar; this is where typos get caught. Then it executes it.
Modern engines add a third move for free. They watch which parts of your code run most often. Those parts are quietly turned into raw machine code for extra speed. The trick is called JIT — just-in-time compilation.
A fact worth knowing: the language’s official name is ECMAScript — a published standard all engines agree to follow. That agreement is why the same code runs in Chrome, Firefox and Safari. “JavaScript” is the everyday name; “ES2023” means a version of the standard.
Fun fact: Chrome’s engine is literally named after a car engine — the V8, eight cylinders of muscle-car power. Google wanted the name itself to promise speed.
The joke continues inside it, too. V8’s two main working parts are nicknamed Ignition (starts running your code right away) and TurboFan (notices code that runs a lot and makes it fly).
Node.js = the V8 engine + extra abilities the browser deliberately does not grant: reading files on your disk, running servers, talking to the operating system. And minus the page itself — there is no HTML in Node, nothing to click.
That trade is exactly why test tools live there. Playwright runs in Node and commands real browsers from the outside. You will see that architecture again in Phase 11.
✏️ Quick check 1
A page has a button that changes color when hovered, and shows a popup when clicked. Which language does which?
✏️ Quick check 2
What is Node.js?
✏️ Quick check 3
Chrome, Firefox and Safari have different engines, yet the same JavaScript runs in all three — because every engine follows one published rulebook. Type its name.
🗣️ Now teach it back
Explain to a friend: what are the three languages of a web page (use the body analogy or your own), and where does JavaScript actually run when someone visits a website?
Write it as if your friend is sitting next to you. Saved to your journal — future-you will use these notes to teach others.