I’m very new to JavaScript. I’m reading from JavaScript good parts. It says :
Every function object is also created with a prototype property
So I did something like this :
function test() {
}
console.log(test.prototype);
Using Chrome’s developer tools, I find the output as follows :

I’m really confused with this output. Why does constructor‘s prototype property again nested with constructor? And why does this goes on like a chain? Where I’m missing the concept?
Thanks in advance.
The
prototypeproperty of a function holds the object from which all instances of that function will inherit when created with thenewoperator. And all these prototype objects (usually) have aconstructorproperty which points back to the function – there you have the circular reference. So, as anew test()inherits that property,(new test).constructor === testevaluates totrue.You will need to distinguish between the
prototypeproperty of a function object and the prototype object from which an object inherits – often referenced as “the internal[[prototype]]property”.A constructor is a function, not to say a
Function, and has both. Therefore it inherits from theFunction.prototypeobject – where theconstructorproperty says that all functions are constructed by theFunctionconstructor. If your developers console would show the prototype ofFunctionobjects, you could see them. I think there is an option in the settings.So, the famous “prototype chain” is not about the
constructorand/orprototypeproperties, but about the prototype object from which that object inherits from: