__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;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…