The Origins of JavaScript: Ten Days That Shaped the Web

In 1995 the web was mostly static. A page was a document you read, and if you wanted it to react to a click or check a form before it was submitted, you waited for a round trip to the server. One engineer at Netscape was given a few weeks to fix that, and the language he produced now runs in every browser, on servers, at the network edge, and inside devices that have no screen at all. The strange part is how much of that was accident, and how little of it was planned.

A browser war and a ten-day language

Brendan Eich joined Netscape in April 1995.[1] Marc Andreessen and the Netscape leadership wanted a lightweight "glue" language that web designers and part-time programmers could drop directly into a page, something to sit alongside Java rather than compete with it. Eich was recruited with the pitch that he could bring Scheme, a dialect of Lisp, into the browser. Management had a different idea. Java was the language everyone was talking about, and they wanted the new scripting language to look like it.

Eich wrote the first working prototype in about ten days in May 1995.[2] It carried the internal name Mocha, shipped in early Netscape Navigator 2.0 builds as LiveScript, and was renamed JavaScript that December as part of a marketing arrangement between Netscape and Sun Microsystems. The name was a business decision meant to borrow Java's momentum. The two languages share some surface syntax and almost nothing else. That single naming choice has confused new programmers for thirty years.

Three languages in a trench coat

The curly braces and the for loops make JavaScript look like a cousin of Java and C. Its actual design comes from somewhere more interesting.

First-class functions and closures came from Scheme. A function in JavaScript is a value you can pass around, return from another function, and store for later, and it remembers the variables that were in scope when it was created. Prototypal inheritance came from a language called Self, where objects inherit directly from other objects instead of from classes. The familiar syntax came from Java. The job Eich was actually given was to make a Scheme-like language wear a Java costume, and that tension explains why the language feels the way it does.

The result was dynamic, object-based without real classes for its first two decades, and functional at its core. Those were unusual choices for a language aimed at beginners in 1995, and they are a large part of why it survived.

The ECMAScript name and a standards fight

Microsoft shipped its own version, JScript, in Internet Explorer 3 in 1996.[3] It was reverse-engineered from Netscape's implementation and close enough to be useful, different enough to cause pain. With two vendors shipping slightly incompatible languages, the web risked splintering before it got started.

Netscape submitted the language to Ecma International, a standards body, and the first specification, ECMA-262, landed in June 1997.[4] The committee could not call the standard "JavaScript" because Sun held the trademark, so the specification got the clumsy name ECMAScript, which is why you still see both terms today. The committee that maintains it is called TC39.[5]

The early editions moved quickly. The second edition arrived in 1998, the third in 1999 with regular expressions and try/catch. Then the work stalled. A proposed fourth edition was ambitious, with classes, modules, and optional static typing, and it collapsed under disagreement between the people building browsers. It was abandoned around 2008. The fifth edition in 2009 was the modest, pragmatic version that actually shipped, adding strict mode, native JSON support[6], and better property controls.

The leap: ES2015 and a yearly rhythm

The sixth edition, officially ES2015 and still widely called ES6, is the release that modernized the language. It brought let and const, arrow functions, real class syntax layered over the old prototype system, template literals, destructuring, default parameters, Promises for asynchronous code, and a module system with import and export.

After ES2015 the committee switched to a yearly release cadence with a staged proposal process, so features now ship when they are ready rather than waiting for a giant version. ES2017 added async/await, which made asynchronous code read like ordinary sequential code and quietly changed how most of us write JavaScript.

Escaping the browser: V8 and Node

For most of its life JavaScript was slow and confined to the page. Google changed the first part in 2008 with V8, the engine built for Chrome[7], which compiled JavaScript down to machine code and made it fast enough to take seriously. Ryan Dahl changed the second part in 2009 with Node.js[8], which took V8 out of the browser and paired it with a non-blocking event loop built for network input and output. For the first time you could write a web server in the same language as the front end.

Node brought npm with it, now the largest package registry in software. A language that started as a form validator became a tool you could use for an entire product, top to bottom, and later for build tooling, command-line programs, and serverless functions.

Why the awkward parts are the point

JavaScript runs on a single thread with an event loop, which sounds like a limitation until you realize it is why the language handles thousands of concurrent connections without the usual threading headaches. Its dynamic typing and automatic type coercion produce genuinely strange results, and an entire genre of conference talks exists to mock them. Those same flexible objects and first-class functions are the reason the language bent to fit every new job it was handed. TypeScript later added a static type layer on top for teams that wanted guardrails, and that is a story of its own.

What it means today

JavaScript runs in every browser, on servers through Node, Deno, and Bun, at the edge, and in embedded runtimes. It is the default language of the web not because it was the best design available in 1995 but because it was there, it was good enough, and it kept getting refined by people who could not afford to break the billions of pages already written in it.

The language almost called LiveScript, prototyped in ten days to look like something it was not, turned out to be one of the most consequential pieces of software ever written. If you build for the web, you are building on that ten-day sketch, polished by three decades of careful work.

Sources (8)
  1. Wikipedia: Brendan Eich
  2. Wikipedia: JavaScript
  3. Wikipedia: JScript
  4. ECMA-262, 1st edition
  5. Ecma International: TC39
  6. Wikipedia: ECMAScript version history
  7. Wikipedia: V8 (JavaScript engine)
  8. Wikipedia: Node.js