1, first to a section of code:
Console.log (Function);//function function () {[native code]}Console.log (Object);//function Object () {[native code]}Console.log (function.prototype);//function () {}Console.log (Object.prototype);//Object {}Console.log (function.__proto__);//function () {}Console.log (function.__proto__.__proto__);//Object {}Console.log (function.__proto__.__proto__.__proto__);//NULLConsole.log (object.__proto__);//function () {}Console.log (object.__proto__.__proto__);//Object {}Console.log (object.__proto__.__proto__.__proto__);//NULL
Console.log (Function.constructor = = = Function); True
Console.log (Object.constructor = = Function)//True
Conclusion:
A, the constructor of the constructor function is itself, so: function.constructor = = = function; The constructor of the constructor Object is itself, so: object.constructor = = = function PS: All constructors constructor point to Function,function is a top-level function;
b, the __proto__ of the constructor function is an anonymous null function () {};
c, anonymous null function () {} __proto__ points to the prototype of object;
D, the __proto__ of object points to the function of the prototype, that is, anonymous null function functions () {};
Object inherits itself, Funtion inherits itself, object and function inherit each other, that is, object and function are both functions and objects. This is a very special point. All functions are objects, but not all objects are functions.
From know:
Object.prototype is the source of all objects
Object.prototype is only mounted on object function objects
Function.prototype structure from Object.prototype
Function.prototype is just mounted on the function object
Object functions and function functions constructed from Function.prototype
Object literal objects {} Constructed from Object.prototype
Object literal {}.__proto__ (original constructed object) = = = Object.prototype
function functions and custom functions are inherited (constructed) from Function.prototype
Function.prototype and Function.__proto__ (original constructed object) are the same
So, there are first object.prototype, then some function.prototype, and then the function and object functions.
Function and object in JavaScript