Prototype inheritance reuses behavior by cloning existing objects that serves as prototypes. JavaScript is a very good example of prototype-based inheritance in practice.

- Stackoverflow.com Wiki
4 articles, 0 books.

How To Shoot Yourself In the Foot With Prototypes!


It is a prototype-based language. The concept of prototyping implies that behavior can be reused by cloning existing objects that serve as prototypes. Every object in JavaScript depends from a prototype which defines a set of functions and members that the object can use. There is no class. Just objects. Every object can then be used as prototype for another object.


Unlike most other languages, JavaScript’s object system is based on prototypes, not classes. Unfortunately, most JavaScript developers don’t understand JavaScript’s object system, or how to put it to best use. Others do understand it, but want it to behave more like class based systems.