Each object in JS has a __proto__ property, and each function (function is also an object) has a natural, but the function also has a prototype property.
function A () {this.x=0;} var a=new a (); alert (A.__proto__===a.prototype)//true
the above constructors are equivalent to doing these three things:
1. Create an Object a={}
2. Initialize it, A.call (a)
3. Assign a value to the A.__proto__ property: A.__proto__=a.prototype
When a calls a property that it does not have, it goes to a.__proto__, which is the same name attribute in A.prototype.
Here's an interesting example:
function A () {}a.prototype.v=1;var a=new A ();//a.__proto__ point to A.prototypea.prototype={v:2};var a2=new A ();//A2.__proto __ points to the new a.prototype, but a.__proto__ does not change alert (A.V);//1alert (A2.V);//2
Plato believed that the creator created the world with the idea of the world as a blueprint or model. If the concept of Java classes and objects is likened to Plato's theory of ideas, JS can be likened to Darwin's theory of evolution. JS does not have the concept of class, each object can have more or less variation
Darwin's theory of evolution vs Plato's Philosophy