JS in each of the creation of a function, the function will automatically have a prototype property, why that??
Because the object on the root has a prototype property, and all the objects in JS inherit from object, so all the objects in JS have a prototype attribute, and in JS the function is the object, So each function in JS also has a prototype attribute.
For example: function person () {...} and function Dog () {...}
And each prototype property gets a constructor property
The constructor property has an implied pointer to the function where the prototype property resides.
This shows that when the Person.prototype.constructor is popped with the alert function, the result is
Function person{....}
When an object instance is created through new person (), the instance contains an implied pointer to the Person.prototype
In conjunction with the previous example, the relationship between the constructor, the instance object, and the prototype object is illustrated by a diagram.
Each instance of person contains a stealth pointer to Person.prototype, in other words, they are not directly related to the constructor function.
You can use isPrototypeOf () to determine whether an instance points to a prototype object, or whether an instance originates from a prototype object.
Alert (Person.prototype.isPrototypeof (p1)) returns True, indicating that P1 points to Person.prototype,
Person.prototype is the prototype object of the instance P1.
JS Object-oriented-prototype object, instance object, constructor relationship