Prototypes and Inheritance

The meaning and utility of the concept of a prototype, as employed in JavaScript, is general and fairly simple. Here is an explanation that does not involve programming:

When we say that B is a prototype for A (or A is an instance of B), we mean that whenever B has a property, such as a color, A will "inherit" that same color, unless explicitly stated otherwise. So in describing A, we don't have to repeat all the information about A that it inherits from B. Think of the effort we save in describing a scarab if we first let on that it is a kind of beetle.

A might inherit from B and B in turn from C. This is called a prototype chain. The basic structures from which JavaScript objects are made are property-to-value links, and prototype chains.