1, the demo code is as follows:
2. Draw as follows:
3. Rules:
1) Each function data type (normal function/Class) has a naturally-built property:prototype (prototype), and this property is the value of an object data type
2) and prototype on the browser was born to add a property Construtor (constructor), the property value is the current function (class) itself
3) Each object data type (normal object, instance, prototype ...) Born with a property:__proto__ (Two _ each), the attribute value is the prototype of the class to which the current instance belongs (prototype)
4)object is the base class for all object data types in JS (topmost class)
5) There is no __proto__ this attribute on Object.prototype
4, summarized as follows:
5. The results are as follows (control Drawing):
function () { // modify own private sumfunction() {// Modify sum on the owning class prototype }
JavaScript Basic Learning Series-prototype chain mode