This figure again shows that every object has a prototype. Constructor function Foo also has its own
__proto__
which is Function.prototype, a
I'll try a 4th grade explanation:
Things are very simple. A prototype
is an example of how something should be built. So:
I'm a function
and I build new objects similar to my prototype
I'm an object
and I was built using my __proto__
as an example
proof:
function Foo() { }
var bar = new Foo()
// `bar` is constructed from how Foo knows to construct objects
bar.__proto__ === Foo.prototype // => true
// bar is an instance - it does not know how to create objects
bar.prototype // => undefined