JavaScript:TheLanguageOfTheWeb
Brendan Eich prototyped it in 10 days at Netscape in 1995 — the name was a marketing piggyback on Java. Thirty years later it runs in every web page you open, on most backend servers, inside AI tooling, and on Mars rover dashboards. The most criticized — and least replaceable — language alive.
StackOverflow Survey
largest open registry alive
every browser speaks it
1995 · Brendan Eich
What is JavaScript
JavaScript is a dynamic, interpreted, single-threaded scripting language built for the browser. In a browser it drives the DOM; on a server it speaks HTTP; in AI tooling it orchestrates LLM calls — one language, thirty years, every layer.
Variables don't carry types — values do. Types resolve at runtime, which is flexible — but errors also only surface at runtime.
No compile step. Source goes into the engine, gets parsed, JITed, and run on the fly. "Write and run" is the language's biggest dev-experience win.
One main thread, period. All "concurrency" is the event loop plus async task queuing. Workers exist, but by default you have exactly one thread.
Objects inherit from other objects, not classes. ES6's class is sugar over the prototype chain. The model is eerily simple — and unreasonably powerful.
var user = { name: "Brendan", age: 35 };
function greet(u) {
var self = this; // this rebound, again
return "Hi, " + u.name;
}
setTimeout(function() {
callback(function() {
// callback hell...
});
});const user = { name: "Brendan", age: 35 };
const greet = (u) => `Hi, ${u.name}`;
async function load() {
const res = await fetch("/api/me");
const { name } = await res.json();
return name ?? "anon";
}
// same language, different planetHistory : Timeline
From a 10-day prototype at Netscape, through the browser wars and a decade of stillness, to the ES6 generational leap and today's multi-runtime landscape — a language that has evolved by addition, never subtraction, for 30 years.
- 1995·05
10 days of "Mocha"
Brendan Eich prototyped it in 10 days at Netscape under the codename Mocha, originally meant to embed Java applets in the browser. Marketing pushed it as a standalone language. The prototype was so rushed that the prototype chain,
thisrules, and coercion quirks all date to those 10 days. - 1995·12
Renamed to JavaScript
December 4th: Netscape and Sun co-announced the rename — pure marketing, riding Java's hype. Thirty years of developers have complained ever since: "Java is to JavaScript as ham is to hamster."
- 1996·08
JScript / browser wars
Microsoft shipped a reverse-engineered clone in IE 3.0 — JScript. The two implementations diverged wildly; web devs had to write a different code path for each browser. The phrase cross-browser compatibility was born here.
- 1997·06
ECMA-262 1st edition
To stop the browser wars, the spec moved to ECMA — standard name
ECMAScript. "JavaScript" was a Netscape trademark, so the spec uses a different name. This still confuses newcomers thirty years later. - 1999·12
ES3 — a decade of stillness
Regex,
try/catch, stricter equality. After ES3 the language sat for ten years — ES4's ambitions were vetoed, and the spec committee deadlocked. The language froze; meanwhile, browser engines quietly grew up underneath. - 2005·02
"Ajax" coined
Jesse James Garrett named the trick that powered Gmail and Google Maps — pages that update without reloading: Ajax. The frontend suddenly stopped being static rendering and started carrying full apps. JS finally got taken seriously.
- 2006·08
jQuery takes over
John Resig shipped jQuery, wrapping the maze of IE6/7/8/9 DOM APIs behind
$(...). It ruled for nearly a decade — at peak it sat on 80% of all websites. "Reach for jQuery first" was every frontend dev's reflex. - 2008·09
V8 + Chrome — the JIT revolution
Google launched V8 and Chrome. JavaScript moved from interpreter to JIT compiler — order-of-magnitude faster. From that moment "JS is slow" stopped being a default assumption and became a tractable engineering problem.
- 2009·05
Node.js — JS on the server
Ryan Dahl wrapped V8 with an event loop and non-blocking IO — Node.js. "JavaScript everywhere" stopped being a slogan and became a roadmap. The npm package manager arrived a year later.
- 2009·12
ES5 thaws the ice
strict mode,JSON.parse,map / filter / reduceon arrays,Object.keys. The decade-long deadlock broke; TC39 started moving again. This is modern JS's first foundation slab. - 2015·06
ES6 / ES2015 — the biggest leap
let / const, arrow functions,class,import / export,Promise, generators, destructuring, template literals, the spread operator — all in one shot. The single biggest upgrade in the language's history. "Modern JS" and "ancient JS" parted ways here. - 2017·06
async / await
ES2017 ships
async / await. "Callback hell" is formally retired. Async code finally reads like sync code; for the first time, a beginner can write a network request without a tutorial detour. - 2020
ES2020 — quality-of-life upgrades
Optional chaining
?., nullish coalescing??, dynamicimport(),BigInt,Promise.allSettled,globalThis. Each small, but stacked together: another step-change in everyday ergonomics. - 2024
TC39's yearly cadence
One release a year, like clockwork. Recent landings: iterator helpers,
Setmethods (union / intersection / difference),Promise.withResolvers. Records & Tuples and Pattern Matching are still in proposal land. Language evolution is now "ship small, ship often." - 2026
Still the world's #1 language
StackOverflow Survey: JavaScript, 13 years running. npm hosts 2.5M+ packages. Native to every browser; Node / Bun / Deno all run it; AI tools (Claude Code / Cursor / v0) emit it by default. The "ESM vs CJS" wound has mostly healed, though a few packages still nurse it.
Language Essentials : JsAlphabet
Thirty years of additive evolution leave a language with more features than anyone remembers. The eight below cover 90% of day-to-day code — internalize them; everything else is an MDN search away.
Prototypes + this
Objects point at another object as "prototype"; lookup walks the chain. this isn't a field on the object — it's injected by the call site.
const animal = { speak() { console.log(this.name); } };
const cat = Object.create(animal);
cat.name = "Mochi";
cat.speak(); // Mochi
const f = cat.speak;
f(); // undefined ← this lostFirst-class fns + closures
Functions are values — pass them, return them, store them. They capture their outer scope at creation time and carry it around. That's a closure.
function counter() {
let n = 0;
return () => ++n;
}
const tick = counter();
tick(); tick(); tick(); // 3
// n 仍活着,被闭包抓住了 / n still aliveDynamic types + coercion
Variables don't have types — values do. + coerces to string the moment a string shows up. JavaScript's most flexible — and most infamous — corner.
1 + "2" // "12" ← string
"5" - 1 // 4 ← number
[] + [] // ""
[] + {} // "[object Object]"
Number("") // 0
// 用 === 不用 == / use ===, never ==The event loop
JavaScript is single-threaded, but has a scheduler: macrotasks, microtasks, render. Once you grok it, async behavior stops being magic.
console.log("A");
setTimeout(() => console.log("B"), 0);
Promise.resolve().then(() => console.log("C"));
console.log("D");
// A D C B
// 同步 → 微任务 → 宏任务Promise + async / await
A value-that-will-arrive, modeled as an object. async functions auto-wrap into Promises; await lets you write async code that reads like sync.
async function load() {
const res = await fetch("/api/users");
if (!res.ok) throw new Error(res.statusText);
return res.json();
}
const users = await load();Destructuring + spread
Pull objects and arrays apart by shape. Combined with ... spread, immutable updates become one-liners.
const { name, age = 18 } = user;
const [first, ...rest] = items;
const next = { ...user, age: user.age + 1 };
const all = [...a, ...b, 42];ESM modules
import / export, statically analyzable. Every file is its own scope — no more global pollution. Native in Node 22+, Bun, Deno, and every modern browser.
// math.js
export function add(a, b) { return a + b; }
export const PI = 3.14159;
// app.js
import { add, PI } from "./math.js";Optional chaining + nullish
ES2020's ?. and ??. The defensive "a && a.b && a.b.c" pattern finally went extinct.
const city = user?.address?.city;
// undefined if any link is null
const page = query.page ?? 1;
// only fall back on null / undefined
// (0 and "" stay)All adds, no subtractions
In 30 years, TC39 has almost never removed a feature. var, ==, prototypes, the this quirks — all permanent residents. Learning JS isn't just learning best practice; it's knowing which paths to avoid.
"JavaScript wasn't designed — it evolved."
Why JS Ate the World : WhyJS
No language wins because it was beautifully designed. JS won because it was in the right place at the right time — the browser. The next thirty years were compound interest.
Every browser speaks it
Chrome / Safari / Firefox / Edge — your code runs with zero install. No other language has this foundation. 3 billion devices are simultaneously its runtime.
// open devtools, anywhere
alert("Hello");Never break the web
That line of code from 1996 still runs in 2026. JavaScript is backward-compatible forever, by design. The greatest promise the language ever made — and the reason it carries every old design wart with it.
// 1996
var x = 1;
// 2026 — still runsAsync in the genes
Single-threaded plus event loop — designed for the browser, generalized to servers, IoT, edge functions. Node, Bun, Deno, Cloudflare Workers — all incarnations of the same model.
setTimeout(tick, 0);
fetch(url).then(render);
// the loop schedules everythingnpm — the largest registry alive
2.5M+ packages, 200B+ monthly downloads. One npm install pulls in a full SDK. The ecosystem's reach is unmatched by any other language.
npm i react vite zod
// three industries arrive in 5sTC39 — slow but durable
Every proposal goes through 4 stages. Slow — but everything that lands stays permanently. The community complains about pace, but nobody wants to return to the ES4 era of "throw everything in."
// stage 0 → 1 → 2 → 3 → 4
// once at 4, it's in the language
// for the next 30 years"Just run it"
No compile step. Write, run, see. The language is built around the prototype → validate → iterate loop. Not the most rigorous, but the fastest path from idea to demo.
// 0 boilerplate
document.title = "hi";
// → doneAI tooling's native tongue
Claude Code, Cursor, v0, Bolt — AI code generators speak JS/TS most fluently. JS dominates the training corpus, and models are most accurate on it.
// "build me a todo list"
// → 80 lines of React + JS
// in seconds, mostly correctReaches every platform
Desktop (Electron / Tauri), mobile (React Native / Capacitor), terminal (Ink), embedded (Espruino), an entire phone OS (KaiOS), font editors (FontForge), even spacecraft dashboards. Wherever JS can run, someone is writing JS.
// same language, all platforms
// VS Code · WhatsApp Desktop
// NASA Mars rover dashboardFrom day-1 to decade-10
Lesson one: alert("Hi"). A decade later: a 1.5M-line VS Code in the same language. Low floor, very high ceiling — the core reason it has lasted.
// day 1
alert("Hi");
// year 10
// VS Code, Figma, Linear...Who's Using : ProductionUsers
From Netflix streaming and PayPal payments to VS Code, Figma, and Discord — almost every app you touch daily is running JS. The 12 below barely scrape the surface.
JavaScript in the : AI Era
AI tooling speaks JS overwhelmingly — not because it's elegant, but because it dominates the public-code corpus. LLMs have seen more JS than any other language, and their first-shot accuracy reflects it. A moat built on data scale.
"JavaScript doesn't have to be the best language. It just has to be there — in every browser, on every syllabus, in every company. When an AI model picks a default output language, it picks the one it has seen most — and that's JS. The first law of language ecology: scale is destiny.
2025 benchmarks across Claude / GPT / Gemini, identical prompts: JS / TS produced the highest first-shot success rate. The reason is direct — the public training corpus is dominated by JavaScript.
The largest open-source registry alive. When AI reaches for "a library to do X," npm is the first place it looks. The ecosystem's pulse: 200B+ downloads / month.
Cursor / Continue / v0 / Bolt / Lovable / Claude Code — every mainstream AI coding tool is written in JS or TS. Electron + React + Node is now the de-facto AI-tool stack.
v0 + AI SDK
You describe "I want a login page" in plain English; v0 outputs a complete Next.js + React + Tailwind page — powered by Vercel AI SDK calling an LLM under the hood. Every step is JS: the model call, the component synthesis, even the runtime it deploys to.
- Vercel AI SDK — 20M+ monthly downloads, provider-agnostic
- Next.js / React — the framework v0 emits
- Edge Runtime — JS on millisecond-cold-start workers
One line: JS is the universal currency of AI coding, from input to output.
// AI SDK · one call, structured output
import { generateObject } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { z } from "zod";
const { object } = await generateObject({
model: anthropic("claude-opus-4-7"),
schema: z.object({
title: z.string(),
items: z.array(z.string())
}),
prompt: "a todo list, 3 items"
});AI tool chain · almost entirely JS / TS
The feedback loop
Big JS share in the corpus → LLM is more accurate at JS → people use AI to ship more JS → that JS lands in the next training set → loop.
The loop has been running for 3-4 years now, and the result is that JS's moat keeps widening in the AI era. Other languages aren't broken — but the model is less confident in them, the user reviews more, and the cost compounds. Market forces drift toward JS.
The flip side: the day AI tools stop being written in JS, it'll mean a new language has shown up that even the models prefer. Don't hold your breath.
// public-code corpus estimate · 2025
const corpus = {
javascript: "~24%",
python: "~17%",
typescript: "~10%",
java: " ~9%",
other: "~40%"
};
// JS + TS ≈ 34% · more than any single rival
// model fluency in JS = how much JS it has seenSummary, one line: JavaScript isn't the AI era's best language — it's the most irreplaceable one. Browsers depend on it, the ecosystem is anchored by it, training data is dominated by it. Thirty years of compound interest hardened into a moat.
vs TypeScript : JS vs TS
JS and TS aren't two languages — they're two postures of the same language. JS's flexibility built the web; TS's discipline carries the enterprise. This site's /code/ts page is the other face of the same coin.
| JavaScript | TypeScript | |
|---|---|---|
| Compile step | None — just run it | tsc / esbuild / Node 22+ strip |
| Type checking | Runtime only | Compile-time / live in IDE |
| Startup | Instant | Compile cost |
| Flexibility | 100% — anything goes | Constrained — forces you to think |
| Refactoring | Grep + prayer | Type-driven, one-click |
| Prototyping | Unbeatable | A touch slower; types ask for completion |
| Maintainability at scale | Snowballing bugs | Type signatures = contracts |
| 3rd-party libs | Native, zero overhead | Need @types/* or built-in d.ts |
| LLM coding | Biggest corpus, top accuracy | Types as guardrails, errors catch faster |
| AI tool stacks use | The runtime layer | The application layer |
| Learning curve | Lesson one | JS plus one more layer |
| Philosophy | Get it running | Think it through first |
Outlook : TheRoadAhead
Language evolution is now "ship small, ship often" — TC39 yearly; runtimes are blooming — Bun / Deno / Edge; the AI-tool coupling deepens. Thirty years in, the moat keeps widening.
The "post-Node" runtime era
The server side has been Node's territory for over a decade — but the wind shifted in 2024: Bun starts 4× faster than Node, eats TS / JSX natively, ships SQLite; Deno tightens the security model and ships a fatter standard library; Cloudflare Workers / Vercel Edge push JS into millisecond-cold-start edge territory.
The endgame isn't replacement — it's one language, four runtimes, each with its niche: Node for ecosystem, Bun for performance, Deno for safety, edge runtimes for deployment.
Records & Tuples
Immutable #{ a: 1 } and #[1, 2], compared by value. Once it lands, the old "Map with object keys" pain disappears and functional-style code finally reads naturally.
Status: Stage 2, deadlocked for years on === semantics.
Type annotations as comments
TC39 Stage 1 proposal: treat TS-style annotations as comments — JS engines simply ignore them. If it lands, the separate tsc step disappears and "JS that runs TS" becomes literal.
WASM, JS's escape hatch
Compute-heavy work (image processing, compression, SIMD, 3D) goes to WASM; UI and orchestration stay in JS. Figma's design algorithms, AutoCAD Web, Photoshop Web, Google Earth — all real-world WASM + JS in production.
The LLM's go-to output
2025 benchmarks: across mainstream LLMs and identical prompts, JS / TS produce the highest first-shot success rate — simply because the training corpus is dominated by them. The more AI spreads, the wider JS's moat: language and model are in a positive feedback loop.
13 years as #1 most used
StackOverflow Survey: JavaScript has been the most-used language for 13 straight years. GitHub contributor counts were only overtaken by TypeScript in 2025 — and TS is just another spelling of JS.