__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
:
(__proto__
是在查找链用来解决方法,实际的对象等prototype
是用于构建对象__proto__
当你创建一个对象与new
:)
( new Foo ).__proto__ === Foo.prototype;
( new Foo ).prototype === undefined;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…