2016-03-20 16 views

答えて

3

__proto__は、自分の財産ではありません。これはオブジェクトのプロトタイプ([[Prototype]])を取得して設定するために内部的に実装されたゲッターまたはセッターであるObject.prototypeのプロパティです。

< Object.getOwnPropertyDescriptor(Object.prototype, '__proto__') 
> Object {enumerable: false, configurable: true, get: function..., set: function...} 
0

__proto__オブジェクトのprototypeから継承されたプロパティです:

Object.getOwnPropertyNames({}) // prints "[]", no properties 
'__proto__' in {}    // prints "true", it's inherited from prototype 

あなたが直接prototypeから__proto__記述子を取得することができます。

Object.getOwnPropertyDescriptor(Object.getPrototypeOf({}), '__proto__'); 
// prints {enumerable: false, ... } 
関連する問題