Prototype Object : Any function has the prototype property, which is a pointer to the function object, and the prototype property contains the properties and methods shared by all instances. All prototype objects have a constructor property, which is a pointer to the function where the prototype property resides.
prototype chain : Each constructor has a prototype object, the prototype object has a Costruct property, a pointer to the constructor, an instance of the constructor has a prototype property, which is an internal pointer to the prototype object. If the prototype of an object A is an instance of object B, then A's prototype object contains a pointer to the B prototype object, so that layers of progression form the chain of instances and prototypes. This is the prototype chain.
prototype chain inheritance : Inheritance is implemented by creating an instance of a constructor, where the child's prototype property equals an instance of the father's constructor, so that the prototype attribute of the child's prototype object points to the father's prototype object. All the attributes and methods that existed in the father's instance are now in the child's prototype object, thus establishing an inheritance relationship.
function parent () {}parent.prototype.parentname= "Da"; function Child () {}child.prototype=new parent (); Child.prototype.childName="Xiao"; var New Child ();
JavaScript's prototype