Maizere Pathak
Maizere Pathak

Reputation: 299

Function Object Internal Prototype

It is said every javascipt object have internal prototype property,then predefined Function object also have the internal prototype property.So which object prototype does its internal prototype called proto points to?

function Object(){}
alert(Object.constructor)//function Function(){[native code]}

so i m referring to the internal prototype of the function Function(){} object not its prototype property . like Function object instance have their internal prototype pointing to Function object.prototype likewise Function object internal prototype point to what?not taking about the prototype property that gets added to it.I know what will the internal prototype of the prototype object points to.

Upvotes: 2

Views: 154

Answers (2)

Elliot Bonneville
Elliot Bonneville

Reputation: 53311

In Javascript, functions are just a specific type of object. Thus a function's prototype is the same thing as an object's prototype. For more reading on functions as objects, check out this link.

Upvotes: 0

zzzzBov
zzzzBov

Reputation: 179046

All objects inherit from Object.prototype, but they may inherit from other prototypes as well depending on the type of object. Functions inherit from Function.prototype (which inherits from Object.prototype).

Upvotes: 2

Related Questions