Summarize the opinions on the Internet for the understanding of prototype and prototype chain and give your own understanding:
What is a prototype?
Each function has a prototype property, which points to an object, the prototype object. The primary use is to share properties and methods with instances.
Ii. The relationship between prototypes?
Each Function has a prototype.
Each instance object has a __proto__ (implicit prototype).
__proto__ == constructor. Prototype
What is a prototype chain?
In jS if access to an object itself does not exist properties or methods, the first will be the object of the prototype object to look for, if the prototype object does not exist, then continue to look for the prototype object of the prototype object, until found.
Prototype ends with object. prototype, and the __proto__ value of this Object is null. These layers of prototypes are the prototype chain.