[英語から日本語への翻訳依頼] オブジェクトの__proto__ プロパティは、 そのオブジェクトを内部[[Prototype]](しばしば"the prototype"と呼ばれる)とし...

この英語から日本語への翻訳依頼は linne0213 さん blackdiamond さん o63odt さんの 3人の翻訳者によって翻訳され、合計 4件の翻訳が投稿されました。 依頼の原文の文字数は 1336文字 で、翻訳完了までにかかった時間は 5時間 23分 です。

xargsによる依頼 2013/09/28 06:28:47 閲覧 1805回
残り時間: 終了

An Object's __proto__ property references the same object as its internal [[Prototype]] (often referred to as "the prototype"), which may be an object or, as in the default case of Object.prototype.__proto__, null . This property is an abstraction error, because a property with the same name, but some other value, could be defined on the object too. If there is a need to reference an object's prototype, the preferred method is to use Object.getPrototypeOf.
A __proto__ pseudo property has been included in §B.3.1 of the draft ECMAScript ed. 6 specification (note that the specification codifies what is already in implementations and what websites may currently rely on).

オブジェクトの__proto__ プロパティは、 そのオブジェクトを内部[[Prototype]](しばしば"the prototype"と呼ばれる)として参照する。この参照の対象は、オブジェクトもしくはObject.prototype.__proto__のデフォルトであるNullとなる。このプロパティは抽出エラーである。これは、同名のプロパティで別の値を持つ場合、そのオブジェクト上で定義することもできるからである。オブジェクトのプロトタイプを参照する必要があれば、Object.getPrototypeOfを使用することが好ましい。
__proto__ 疑似プロパティは、ECMAScript エディション6仕様書草案の§B.3.1に記載されている(この仕様は、既に実装されているものおよびウェブサイトが現在使用している可能性があるものを編纂したものであることに注意)。

Note: that is two underscores, followed by the five characters "proto", followed by two more underscores.
When an object is created, its __proto__ property is set to reference the same object as its internal [[Prototype]] (i.e. its constructor's prototype object). Assigning a new value to __proto__ also changes the value of the internal [[Prototype]] property, except where the object is non–extensible.

To understand how prototypes are used for inheritance, see the MDN article Inheritance and the prototype chain.

In the following, a new instance of Employee is created, then tested to show that its __proto__ is the same object as its constructor's prototype.

注意:2つのアンダースコア(_)、続けて"proto"の5文字、その後さらに2つのアンダースコアである。
オブジェクトが作成されると、その __proto__プロパティは、そのオブジェクトの内部の[[Prototype]](つまり、コンストラクタのプロトタイプ オブジェクト)として参照に設定される。オブジェクトが拡張不能である場合を除き、__proto__に新しい値を割り当てることによっても、内部[[Prototype]]プロパティの値が変化する。

プロトタイプが継承においてどのように使用されるかを理解するには、MDNの「Inheritance and the prototype chain(継承とプロトタイプ チェーン)」という記事を参照。

以下のコードでは、Employeeの新しいインスタンスが作成され、その後__proto__はそのコンストラクタのプロトタイプと同じオブジェクトであることを示すためのテストが行われている。

クライアント

ビジネス目的などより専門性の高い翻訳にはStandard翻訳

  • Word、Excel、PowerPointなど様々なファイル形式に対応
  • 文字数の上限がなく、素早い納品
  • よりスキルの高い翻訳者が担当

まずはお気軽に
お問い合わせください。