We will learn what is the difference between proto and prototype in Javascript
__proto__
is the actual object that is used in the lookup chain to resolve methods, etc.
prototype
is the object that is used to build __proto__
when you create an object with new
:
( new Foo ).__proto__ === Foo.prototype;
( new Foo ).prototype === undefined;
#javascript