Good description from "dead of winter"
The prototype-oriented language idea is exactly the same as the prototype mode: The objects cloned from the same prototype are a class of objects. The prototype-oriented language provides language-level support for this mode, that is, all the definitions of "classes" are implemented by specifying a prototype of the class (class-based programming describes a class object through class structure Declaration, meta-class describes a class object by constructing a class object ). The prototype is cloned once for each instance. However, this method causes information redundancy: all objects hold a clone copy of the prototype object, and once an object is constructed, modifying a prototype does not affect it, which may affectProgramIt is inconvenient for people who change a certain type of objects. Therefore, a work ing method is generated: The reference prototype object, in contrast to the original prototype object usage method is called
Copy the prototype object. The reference prototype object does not clone the prototype, but saves a pointer to the prototype. when accessing the property, first check its own property. When it finds that the property does not exist, then, the pointer is used to obtain the corresponding property from the prototype. The reference prototype is the implementation of JavaScript prototype-oriented features.
Http://blog.csdn.net/dead_of_winter/article/details/1902063
Prototype Oriented http://blog.csdn.net/dead_of_winter/article/details/1646024
Javascript inheritance http://blog.csdn.net/dead_of_winter/article/details/1626003