The prototype

  1. Any function has a prototype attribute
  2. The prototype property of functions is an object; we call it a prototype object.
  3. An instance created by the constructor gives you direct access to any property on the Prototype property.
  4. Any object has a __proto__ attribute that points to the constructor’s Prototype attribute.
  5. The constructor property is a built-in property in the stereotype that points to the current constructor.

Prototype chain

  1. The __proto__ attribute of the object mentioned above points to the constructor’s prototype, and since prototype is also an object, it also has __proto__, forming a chain.
  2. Everything is virtual, so the prototype chain ends up pointing to null.

I see a nice prototype diagram