---
title: "01 — JavaScript — The Only Language the Browser Runs"
uid: introduction-to-javascript
tags: ["ecmascript", "history", "roadmap:javascript", "fundamentals", "javascript"]
excerpt: "JavaScript is one implementation of a specification called ECMAScript — and its only genuinely special property is that browsers ship a JS engine and run nothing else."
date: 2026-08-13T03:28:08+0000
source: https://www.aveshina.my.id/en/blog/introduction-to-javascript
---

"Just a language that runs in the browser" was my JavaScript definition, and it was missing the mechanism. The idea that everything else hangs off: **JavaScript is one implementation of a specification called ECMAScript, and its only genuinely special property is that browsers ship a JS engine and run nothing else.** [1]

The framing that finally landed is the separation between the *spec* and the *language*. ECMAScript is the standard — a document that says "these are the types, these are the operators, this is how scope works." JavaScript is what actually ships in engines like V8 (Chrome, Node), SpiderMonkey (Firefox), and JavaScriptCore (Safari). When someone says "ES6" or "ES2024," they mean *the spec version*. When they say "JavaScript," they mean *the language you write*, which now follows that spec. The distinction matters because it explains why features land unevenly across browsers — each engine implements the spec on its own schedule [3].

```figure
<svg viewBox="0 0 740 240" xmlns="http://www.w3.org/2000/svg" class="my-6 w-full max-w-2xl" role="img" aria-label="The ECMAScript spec feeds two engines. A document on the left labelled ECMAScript Specification sends arrows to two engine boxes: V8 (Chrome and Node.js) and SpiderMonkey (Firefox). Each engine runs JavaScript code. The spec is shared; the engines are separate implementations.">
  <defs>
    <marker id="jsarrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">
      <path d="M0,0 L10,5 L0,10 z" fill="#64748b"/>
    </marker>
  </defs>
  <g font-family="ui-sans-serif, system-ui, sans-serif" text-rendering="geometricPrecision">
    <!-- spec -->
    <rect x="30" y="80" width="170" height="80" rx="10" fill="#e0e7ff" stroke="#6366f1" stroke-width="1.5"/>
    <text x="115" y="110" font-size="13" font-weight="700" fill="#1e1b4b" text-anchor="middle">ECMAScript</text>
    <text x="115" y="128" font-size="11" fill="#475569" text-anchor="middle">the specification</text>
    <text x="115" y="144" font-size="10" fill="#64748b" text-anchor="middle">types · operators · scope</text>

    <!-- engines -->
    <rect x="330" y="40" width="200" height="60" rx="8" fill="#dcfce7" stroke="#16a34a" stroke-width="1.5"/>
    <text x="430" y="64" font-size="13" font-weight="700" fill="#052e16" text-anchor="middle">V8</text>
    <text x="430" y="82" font-size="10.5" fill="#475569" text-anchor="middle">Chrome · Node.js</text>

    <rect x="330" y="140" width="200" height="60" rx="8" fill="#fce7f3" stroke="#db2777" stroke-width="1.5"/>
    <text x="430" y="164" font-size="13" font-weight="700" fill="#500724" text-anchor="middle">SpiderMonkey</text>
    <text x="430" y="182" font-size="10.5" fill="#475569" text-anchor="middle">Firefox</text>

    <!-- arrows -->
    <path d="M202,105 C260,105 280,75 328,70" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#jsarrow)"/>
    <path d="M202,140 C260,140 280,170 328,170" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#jsarrow)"/>

    <!-- output -->
    <rect x="600" y="90" width="120" height="60" rx="8" fill="#fef9c3" stroke="#ca8a04" stroke-width="1.5"/>
    <text x="660" y="114" font-size="12" font-weight="700" fill="#422006" text-anchor="middle">JavaScript</text>
    <text x="660" y="132" font-size="10" fill="#475569" text-anchor="middle">the code you write</text>
    <path d="M530,70 C570,80 580,100 598,110" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#jsarrow)"/>
    <path d="M530,170 C570,160 580,140 598,130" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#jsarrow)"/>
  </g>
</svg>
```

## What JavaScript actually does

Mechanically, JavaScript is a high-level, interpreted (technically, just-in-time compiled) language created to add interactivity to web pages [1][2]. It can manipulate HTML and CSS, respond to user events, talk to servers, and update content without reloading the page. Three things worth pinning down because they shape every line I write:

- **Single-threaded.** JS runs one statement at a time on one main thread. Long work blocks everything — which is why async patterns exist at all.
- **Runs in a host environment.** The language itself has no DOM, no fetch, no file system. Those are *host APIs* the environment provides. The browser hands JS the DOM; Node hands it fs and http. The core language — types, functions, closures — is the same in both.
- **Follows the spec.** New syntax (arrow functions, optional chaining, async/await) is added by ECMAScript revisions, not by browser vendors acting alone.

## The bizarre history

JavaScript has a naming history that confused me for years, and the confusion isn't cosmetic — it explains why the name is misleading. The language was created by Brendan Eich at Netscape in 1995, originally named **Mocha**, then **LiveScript** [4]. In 1996, about a year after release, Netscape renamed it to **JavaScript** purely to ride the marketing wave around Java — despite JavaScript having no technical relationship to Java. The name stuck; the confusion persisted.

The clean-up came in 1997, when JavaScript was submitted to ECMA International and standardized as **ECMAScript** (the spec) to keep the trademark clean [5]. So today: ECMAScript is the standard, JavaScript is the implementation, and the two words are almost, but not quite, synonyms.

## The versions that matter

The version history is short once you know the one breakpoint. Early ECMAScript (ES1–ES3, 1997–1999) was incremental. **ES5** (2009) added strict mode and array methods. The transformative release was **ES6 / ES2015** — it added let/const, arrow functions, classes, modules, promises, destructuring, template literals, and more [5]. After ES6, the spec moved to yearly releases (ES2016, ES2017, … ES2024), each shipping a handful of small additions instead of one giant dump.

The practical effect: "modern JavaScript" usually means "post-ES6," and the language now evolves in small, predictable yearly steps rather than decade-long waits.

## How I actually run it

Three places, depending on what I'm doing:

- **Browser console / DevTools** — the fastest scratchpad. Any modern browser's DevTools console runs JS against the current page's environment, DOM included [6].
- **<script> tag in HTML** — how JS gets into a real web page. Inline or linked, the browser fetches and executes it.
- **Node.js** — a JS runtime built on V8 that runs JS outside the browser, with file system and network access. This is the server-side and tooling side (build tools, CLIs, my own scripts).

For quick experiments, the browser console or a snippet in an online playground is enough. For real work it's either a <script> in a page or a Node process — and which one I pick determines which host APIs are available.

## How I use this

The separation between spec and implementation is the part I reach for most. When a feature doesn't work in some browser, it's not "JavaScript is broken" — it's *that engine hasn't shipped that spec revision yet*, and I check a compatibility table. When I see "ES2022 feature," I know to treat it as a spec addition that may or may not be implemented everywhere I target. And the host-environment framing keeps me honest: document.querySelector is not JavaScript — it's the browser's DOM API, and it won't exist in a Node script.

## References

[1] Mozilla, "JavaScript — Dynamic client-side scripting," MDN Web Docs, 2024. [Online]. Available: [https://developer.mozilla.org/en-US/docs/Web/JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)

[2] I. Kantor and the javascript.info team, "The Modern JavaScript Tutorial," javascript.info, 2024. [Online]. Available: [https://javascript.info/](https://javascript.info/)

[3] K. Simpson, *You Don't Know JS Yet*, 2nd ed., getify, 2020. [Online]. Available: [https://github.com/getify/You-Dont-Know-JS](https://github.com/getify/You-Dont-Know-JS)

[4] roadmap.sh, "Brief History of JavaScript," 2023. [Online]. Available: [https://roadmap.sh/guides/history-of-javascript](https://roadmap.sh/guides/history-of-javascript)

[5] Educative, "JavaScript Versions: How JavaScript has changed over the years," 2023. [Online]. Available: [https://www.educative.io/blog/javascript-versions-history](https://www.educative.io/blog/javascript-versions-history)

[6] DigitalOcean, "How To Use the JavaScript Developer Console," 2020. [Online]. Available: [https://www.digitalocean.com/community/tutorials/how-to-use-the-javascript-developer-console](https://www.digitalocean.com/community/tutorials/how-to-use-the-javascript-developer-console)

```quiz
Q: What is the relationship between ECMAScript and JavaScript?
- JavaScript is the specification; ECMAScript is the language
- ECMAScript is the specification; JavaScript is one implementation of it
- They are two unrelated languages
correct: 1
explain: ECMAScript is the standard (the spec document). JavaScript is the language engines actually implement, following that spec. Browsers ship JS engines, not the spec itself.

Q: Why was the language named "JavaScript" despite having no relation to Java?
- It was originally designed to compile Java in the browser
- Marketing — Netscape wanted to capitalize on Java's popularity in 1996
- It was a typo that shipped
correct: 1
explain: Netscape renamed LiveScript to JavaScript in 1996 to ride Java's marketing wave. The two languages share no technical relationship.

Q: Which ECMAScript version is considered the transformative "modern JavaScript" breakpoint?
- ES3
- ES5
- ES6 (ES2015)
correct: 2
explain: ES6/ES2015 added let/const, arrow functions, classes, modules, promises, and destructuring — the largest single change to the language, marking the start of "modern JavaScript."

Q: `document.querySelector` is part of the core JavaScript language.
- True — it ships with every JS engine
- False — it's a browser host API (the DOM), not part of the core language
correct: 1
explain: The DOM is provided by the browser host environment, not the ECMAScript spec. A Node.js script has no document object because Node provides different host APIs (fs, http).

Q: After ES6, how does ECMAScript evolve?
- In one giant release every decade
- In small yearly releases (ES2016, ES2017, ...)
- It stopped evolving after ES6
correct: 1
explain: Since 2015 the spec moves to yearly editions, each shipping a handful of small additions rather than occasional massive dumps.
```
