JavaScript runtime has many global objects and functions. Global object function is a function in JavaScript which is called as Object
Let's see an example:
console.log(Object); //Global constructor function with name as ObjectAbove statement gives the definition of the Object function.
Prototype of the Object() function
console.log(Object.prototype); //Global constructor function with name as ObjectLet's call this function
console.log(Object()); //Outputs: Empty object with __proto__ prpertyObject() gives an object which is empty and have proto property This object is inherited by all other objects in JavaScript
__proto__ property points to the prototype object of the constructor function i.e Object()
var obj = Object()
console.log(obj.__proto__); //Outputs: An object with some properties
console.log(a.__proto__ === Object.prototype) //trueLet's create an empty functiom
var a = function(){}
console.log(a.prototype)Above image shows that a.prototype has two propertis
- constructor - which points to the function itself (console.log(a === a.prototype.constructor) // true)
- proto - which is inherited from Object()
console.log(a.prototype.__proto__ === Object().__proto__); //Output: true



