---
title: "Chapter 2. Objects Without Classes"
url: "https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch02"
locale: "en"
author: "Mikhail Savchenko (Mike Fluff)"
updated: "2026-11-18T12:24:57.879Z"
book: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems"
access: "lead-in"
purchase: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems"
alternates:
  - locale: "ru"
    url: "https://www.mikefluff.com/ru/read/from-closures-to-autonomous-systems/ch02"
    markdown: "https://www.mikefluff.com/ru/read/from-closures-to-autonomous-systems/ch02.md"
  - locale: "en"
    url: "https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch02"
    markdown: "https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch02.md"
  - locale: "pt"
    url: "https://www.mikefluff.com/pt/read/from-closures-to-autonomous-systems/ch02"
    markdown: "https://www.mikefluff.com/pt/read/from-closures-to-autonomous-systems/ch02.md"
---

# Chapter 2. Objects Without Classes

*[JavaScript: From Closures to Autonomous Systems](https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems)*

Eich chose Self-style delegation as early as May 1995 and expected it to come out even faster than classes: one link to a prototype, and through it the object gets everything it cannot do itself. He did not manage to expose that link to the programmer in ten days. In JavaScript 1.0, which shipped in March 1996 with Navigator 2.0, there was no way to ask an object to inherit anything from another object.

How people lived under those conditions can be seen in an example from the history of the language written by Allen Wirfs-Brock and Eich himself. Shared methods were handed out to every instance by hand, right in the constructor:

```
function ptSum(pt2) { return new Point(this.x + pt2.x, this.y + pt2.y); }

function Point(x, y) {
  this.x = x;
  this.y = y;
  this.sum = ptSum;   // every point gets its own reference to the method
}
```

There is one function `ptSum`, but a reference to it has to be handed to every point. If tomorrow you need a `distance` method, you have to dig into the constructor, and points created before that will live out their lives without it. For half-screen scripts this was enough; nobody wrote anything longer in JavaScript back then.

* * *

In 1996, together with Navigator 3, came JavaScript 1.1. Every function got a `prototype` property, and the Self mechanism finally surfaced. Methods were now put on the prototype once, and points created with `new` found them on their own:

```
function Point(x, y) { this.x = x; this.y = y; }
Point.prototype.sum = ptSum;
Point.prototype.distance = ptDistance;

var origin = new Point(0, 0);
```

The documentation greeted the novelty without fanfare. The JavaScript 1.1 guide described `prototype` as «a property that is shared by all objects of the specified type», and a quarter of a century later Wirfs-Brock and Eich politely call that phrase vague. The vagueness was political. Netscape still stood by the press-release version of 1995: objects, meaning classes, are written in Java, and JavaScript is there to glue those objects together. In that picture of the world, JavaScript’s own ways of describing objects looked superfluous, and they were barely documented. So the mechanism on which all objects of the language would later be built appeared almost unnoticed.

From the outside, a prototype is easy to mistake for a C++ virtual method table, where the constructor works like a class and the points share common methods. As long as the program behaves, that reading works. As soon as it starts using the freedom Self gave it, the reading breaks, because a prototype is a live link. An object follows it every time it does not find a property on itself, and anything that appears on the prototype is immediately visible to all its descendants, including those born earlier:

---

The rest of this chapter is free on the site once the reader confirms an email address: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch02
