Prerequisites
JavaScript: 10 Days That Changed the Web
Brendan Eich's rush job became the world's most ubiquitous programming language. Here's how.
The Brief: Make the Browser Do Things
It’s May 1995. Netscape Navigator is winning the browser wars, and Marc Andreessen wants a “glue language” that makes web pages interactive. Not Java — something simpler, something that designers and part-time programmers can pick up. Brendan Eich is given 10 days to build it.
The result was Mocha (later renamed LiveScript, then JavaScript). It was messy, quirky, and full of design compromises forced by the impossible deadline. And it would become the most widely deployed programming language in history.
The Design Decisions
JavaScript borrowed from several languages, creating a unique blend:
| Influence | What It Contributed |
|---|---|
| Scheme | First-class functions, closures |
| Self | Prototype-based inheritance |
| Java | Syntax, naming (for marketing) |
| Perl | Regular expressions |
// Closures: Scheme's gift to the web
function createCounter() {
let count = 0;
return {
increment: () => ++count,
getCount: () => count,
};
}
const counter = createCounter();
counter.increment();
counter.increment();
console.log(counter.getCount()); // 2
The Quirks That Stuck
JavaScript’s 10-day origin left permanent scars:
typeof null // "object" (a bug from day one, never fixed)
0.1 + 0.2 // 0.30000000000000004
"" == false // true
[] == false // true
"" == [] // true... but [] != false? Wait...
These aren’t bugs to be embarrassed by — they’re archaeological artifacts that teach us about language design under pressure.
Why This Matters
JavaScript’s story connects directly to the TCP/IP foundation: without a reliable network layer, there would be no browser, and without a browser scripting language, the web would have remained a collection of static documents. JavaScript is what made the web a platform, not just a library.