Each function belongs to an object, and there is a property called prototype. This property points to an object that we call the prototype object of the current function. Below the prototype object is a property called constructor. This property points to the current function. Functions are also divided into ordinary functions and constructors. Here we talk about constructors. Define a function:
function person (x, y) {this.age = X;this.name = y;
}var xiaoming= New Person ("xiaoming");
Here to create an instance of the object xiaoming is called the person constructor, so that Xiaoming has its own properties and methods, and then xiaoming and person there is no direct intersection (can be understood as xiaoming broke up, hey programmer very difficult ╥. ╥) But each instance object will have a hidden property [[prototype]], which is called __proto__ in Chrome/firefox, and is only for learning and debugging purposes. It points to the prototype object of the constructor.
Concepts and relationships for constructors, instances, and prototypes