aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/object
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/javascript/reference/global_objects/object
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/__definegetter__/index.html107
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/__definesetter__/index.html92
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/__lookupgetter__/index.html121
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/__lookupsetter__/index.html139
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html321
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html235
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/count/index.html88
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/create/index.html227
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html183
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html545
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/entries/index.html134
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html85
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html206
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/fromentries/index.html105
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html93
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html147
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptors/index.html87
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html169
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getownpropertysymbols/index.html85
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html137
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/hasownproperty/index.html168
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/index.html183
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/is/index.html150
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html144
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html153
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/isprototypeof/index.html171
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html124
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html158
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html208
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/object/index.html80
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html160
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html43
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html131
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/propertyisenumerable/index.html146
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/proto/index.html142
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/prototype/index.html194
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html151
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/setprototypeof/index.html233
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/tolocalestring/index.html80
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/tosource/index.html128
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/tostring/index.html139
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html133
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html105
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html208
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/values/index.html113
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html201
46 files changed, 7152 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/__definegetter__/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/__definegetter__/index.html
new file mode 100644
index 0000000000..28773a6bc8
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/__definegetter__/index.html
@@ -0,0 +1,107 @@
+---
+title: Object.prototype.__defineGetter__()
+slug: Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__
+---
+<div>
+ {{JSRef("Global_Objects", "Object")}} {{non-standard_header}} {{deprecated_header}}</div>
+<h2 id="Summary" name="Summary">概述</h2>
+<p><code><strong>__defineGetter__</strong></code> 方法可以将一个函数绑定在当前对象的指定属性上,当那个属性的值被读取时,你所绑定的函数就会被调用。</p>
+<h2 id="Syntax" name="Syntax">语法</h2>
+<pre class="syntaxbox"><code><var>obj</var>.__defineGetter__(<var>prop</var>, <var>func</var>)</code></pre>
+<h3 id="Parameters" name="Parameters">参数</h3>
+<dl>
+ <dt>
+ <code>prop</code></dt>
+ <dd>
+ 一个字符串,表示指定的属性名。</dd>
+ <dt>
+ <code>func</code></dt>
+ <dd>
+ 一个函数,当 <code>prop</code> 属性的值被读取时自动被调用。</dd>
+</dl>
+<h2 id="Description" name="Description">描述</h2>
+<p><code>__defineGetter__ 方法可以为一个已经存在的对象设置(新建或修改)访问器属性,</code>而 {{jsxref("Operators/get", "对象字面量中的 get 语法", "", 1)}} 只能在新建一个对象时使用。</p>
+<h2 id="Examples" name="Examples"><span class="def"><span>示例</span></span></h2>
+<pre class="brush: js">// 请注意,该方法是非标准的:
+
+var o = {};
+o.__defineGetter__('gimmeFive', function() { return 5; });
+console.log(o.gimmeFive); // 5
+
+
+// 请尽可能使用下面的两种推荐方式来代替:
+
+// 1. 在对象字面量中使用 get 语法
+var o = { get gimmeFive() { return 5; } };
+console.log(o.gimmeFive); // 5
+
+// 2. 使用 Object.defineProperty 方法
+var o = {};
+Object.defineProperty(o, 'gimmeFive', {
+ get: function() {
+ return 5;
+ }
+});
+console.log(o.gimmeFive); // 5
+</pre>
+<h2 id="Specifications" name="Specifications">规范</h2>
+<p>不属于任何规范。</p>
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
+<div>
+ {{CompatibilityTable}}</div>
+<div id="compat-desktop">
+ <table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatIE("11")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+<div id="compat-mobile">
+ <table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+<h2 id="See_also" name="See_also">相关链接</h2>
+<ul>
+ <li>{{jsxref("Object.prototype.__defineSetter__()")}}</li>
+ <li>{{jsxref("Operators/get", "get")}} operator</li>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li>{{jsxref("Object.prototype.__lookupGetter__()")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">JS 指南: 定义 Getter 和 Setter</a></li>
+ <li><a href="http://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/">[个人博文] defineGetter__ 和 __defineSetter__已被废弃</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/__definesetter__/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/__definesetter__/index.html
new file mode 100644
index 0000000000..81a159b69f
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/__definesetter__/index.html
@@ -0,0 +1,92 @@
+---
+title: Object.prototype.__defineSetter__()
+slug: Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__
+---
+<div>
+ {{JSRef("Global_Objects", "Object")}} {{non-standard_header}} {{deprecated_header}}</div>
+<h2 id="Summary" name="Summary"><span class="def"><span>概述</span></span></h2>
+<p><code><strong>__defineSetter__ </strong>方法可以将一个函数绑定在当前对象的指定属性</code>上,当那个属性被赋值时,你所绑定的函数就会被调用。</p>
+<h2 id="Syntax" name="Syntax">语法</h2>
+<pre class="syntaxbox"><code><var>obj</var>.__defineSetter__(<var>prop</var>, <var>fun</var>)</code></pre>
+<h3 id="Parameters" name="Parameters">参数</h3>
+<dl>
+ <dt>
+ <code>prop</code></dt>
+ <dd>
+ 一个字符串,表示指定的属性名。</dd>
+ <dt>
+ <code>fun</code></dt>
+ <dd>
+ 一个函数,当试图去为 <code>sprop</code> 属性赋值时被调用。通常你要给这个函数指定一个参数:<br>
+ <pre>function(<var>val</var>) { . . . }</pre>
+ <dl>
+ <dt>
+ <code>val</code></dt>
+ <dd>
+ 任意的参数名,在 fun 被调用时,该参数的值就是尝试给 <code>sprop</code> 属性所赋的值。</dd>
+ </dl>
+ </dd>
+</dl>
+<h2 id="Description" name="Description">描述</h2>
+<p><code>__defineSetter__</code> 方法可以为一个已经存在的对象设置(新建或修改)访问器属性,而 {{jsxref("Operators/set", "对象字面量中的 set 语法", "", 1)}} 只能在新建一个对象时使用。</p>
+<h2 id="Specifications" name="Specifications">规范</h2>
+<p>不属于任何规范。</p>
+<h2 id="Browser_compatibility" name="Browser_compatibility"><span class="def"><span>浏览器兼容性</span></span></h2>
+<div>
+ {{CompatibilityTable}}</div>
+<div id="compat-desktop">
+ <table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatIE("11")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+<div id="compat-mobile">
+ <table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+<h2 id="See_also" name="See_also">相关链接</h2>
+<ul>
+ <li>{{jsxref("Object.prototype.__defineGetter__()")}}</li>
+ <li>{{jsxref("Operators/set", "set")}} operator</li>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li>{{jsxref("Object.prototype.__lookupSetter__()")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">JS 指南: 定义 Getter 和 Setter</a></li>
+ <li><a href="http://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/">[个人博客] defineGetter__ 和 __defineSetter__</a>已被废弃</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/__lookupgetter__/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/__lookupgetter__/index.html
new file mode 100644
index 0000000000..a94f293880
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/__lookupgetter__/index.html
@@ -0,0 +1,121 @@
+---
+title: Object.prototype.__lookupGetter__()
+slug: Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__
+---
+<div>{{JSRef("Global_Objects", "Object")}} {{ Non-standard_header }} {{ Deprecated_header }}</div>
+
+<h2 id="Summary" name="Summary">概述</h2>
+
+<p><code><strong>__lookupGetter__</strong></code> 方法会返回当前对象上指定属性的<strong>属性读取访问器函数(getter)。</strong></p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code><em>obj</em>.__lookupGetter__(<em>sprop</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>sprop</code></dt>
+ <dd>属性名</dd>
+</dl>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<pre class="brush: js">var obj = {
+ get foo() {
+ return Math.random() &gt; 0.5 ? "foo" : "bar";
+ }
+};
+
+obj.__lookupGetter__("foo")
+// (function (){return Math.random() &gt; 0.5 ? "foo" : "bar"}) </pre>
+
+<h2 id="Description" name="Description">附注</h2>
+
+<p><code><strong>__lookupGetter__</strong></code> 方法是非标准的,我们应该使用标准中定义的方法来完成同样的事情,那就是 {{jsxref("Object.getOwnPropertyDescriptor()")}} 方法:</p>
+
+<pre class="brush: js">var obj = {
+ get foo() {
+ return Math.random() &gt; 0.5 ? "foo" : "bar";
+ }
+};
+
+Object.getOwnPropertyDescriptor(obj, "foo").get
+// (function (){return Math.random() &gt; 0.5 ? "foo" : "bar"})
+</pre>
+
+<p>如果那个访问器属性是继承来的,你还需要使用 {{jsxref("Object.getPrototypeOf()")}}:</p>
+
+<pre class="brush: js">var obj = {};
+var prototype = Object.getPrototypeOf(obj);
+Object.getOwnPropertyDescriptor(prototype, "foo").get
+// function __proto__() {[native code]}
+</pre>
+
+<h2 id="Specifications" name="Specifications">规范</h2>
+
+<p>不属于任何规范。</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{CompatVersionUnknown() }}</td>
+ <td>{{CompatVersionUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown() }}</td>
+ <td>{{CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{CompatVersionUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.__lookupSetter__", "Object.prototype.__lookupSetter__()")}}</li>
+ <li>{{jsxref("Operators/get", "get")}} 运算符</li>
+ <li>{{jsxref("Object.getOwnPropertyDescriptor()")}} 和 {{jsxref("Object.getPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.__defineGetter__", "Object.prototype.__defineGetter__()")}}</li>
+ <li>{{jsxref("Object.__defineSetter__", "Object.prototype.__defineSetter__()")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters" title="JavaScript/Guide/Creating_New_Objects/Defining_Getters_and_Setters">JS 指南:定义访问器属性</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/__lookupsetter__/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/__lookupsetter__/index.html
new file mode 100644
index 0000000000..6481c7f16b
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/__lookupsetter__/index.html
@@ -0,0 +1,139 @@
+---
+title: Object.prototype.__lookupSetter__()
+slug: Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__
+tags:
+ - 不建议使用
+ - 原型
+ - 对象
+ - 方法
+ - 过时的
+ - 非标准
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__
+---
+<div>{{JSRef}} {{deprecated_header}}</div>
+
+<div><code><strong>__lookupSetter__</strong></code> 方法是用来返回一个对象的某个属性上绑定了 setter (设置器)的钩子函数的引用。</div>
+
+<div> </div>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.__lookupSetter__(<var>sprop</var>)</code></pre>
+
+<h3 id="参数说明">参数说明</h3>
+
+<dl>
+ <dt><code>sprop</code></dt>
+ <dd>一个字符串类型,表示要返回的 setter 钩子的函数名。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>一个绑定了setter的特殊属性的函数引用。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>如果一个 setter 被定义在了一个对象的属性上,则不能直接通过该属性来获取引用 setter 所设置的钩子的函数,因为该属性是该函数的返回值,但,__lookupSetter__ 可以被用来获取对 setter 函数的引用。</p>
+
+<p>不过现在可以使用标准的方法:</p>
+
+<p>{{jsxref("Object.getOwnPropertyDescriptor()")}}.</p>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">var obj = {
+ set foo(value) {
+ this.bar = value;
+ }
+};
+
+
+// 非标准,并且不推荐使用。
+obj.__lookupSetter__('foo')
+// (function(value) { this.bar = value; })
+
+
+// 标准且推荐使用的方式。
+Object.getOwnPropertyDescriptor(obj, 'foo').set;
+// (function(value) { this.bar = value; })
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="spectable standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.__lookupSetter__', 'Object.prototype.__lookupSetter__()')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td>包含在(规范性)附件中,用于Web浏览器的附加ECMAScript遗留功能(请注意,这份规范编撰的内容已经是准备实现的了)。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatIE("11")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.__lookupGetter__()")}}</li>
+ <li>{{jsxref("Functions/set", "set")}} operator</li>
+ <li>{{jsxref("Object.getOwnPropertyDescriptor()")}} and {{jsxref("Object.getPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.prototype.__defineGetter__()")}}</li>
+ <li>{{jsxref("Object.prototype.__defineSetter__()")}}</li>
+ <li><a href="/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">JS Guide: Defining Getters and Setters</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html
new file mode 100644
index 0000000000..13cc1854d6
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html
@@ -0,0 +1,321 @@
+---
+title: Object.assign()
+slug: Web/JavaScript/Reference/Global_Objects/Object/assign
+tags:
+ - ECMAScript 2015
+ - JavaScript
+ - Method
+ - Object
+ - Object.assign
+ - polyfill
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/assign
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.assign()</strong></code> 方法用于将所有可枚举属性的值从一个或多个源对象分配到目标对象。它将返回目标对象。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-assign.html")}}</div>
+
+
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox notranslate"><code>Object.assign(<var>target</var>, ...<var>sources</var>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>target</code></dt>
+ <dd>目标对象。</dd>
+ <dt><code>sources</code></dt>
+ <dd>源对象。</dd>
+</dl>
+
+<h3 id="Return_value" name="Return_value">返回值</h3>
+
+<p>目标对象。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>如果目标对象中的属性具有相同的键,则属性将被源对象中的属性覆盖。后面的源对象的属性将类似地覆盖前面的源对象的属性。</p>
+
+<p><code>Object.assign</code> 方法只会拷贝源对象自身的并且可枚举的属性到目标对象。该方法使用源对象的<code>[[Get]]</code>和目标对象的<code>[[Set]]</code>,所以它会调用相关 getter 和 setter。因此,它分配属性,而不仅仅是复制或定义新的属性。如果合并源包含getter,这可能使其不适合将新属性合并到原型中。为了将属性定义(包括其可枚举性)复制到原型,应使用{{jsxref("Object.getOwnPropertyDescriptor()")}}和{{jsxref("Object.defineProperty()")}} 。</p>
+
+<p>{{jsxref("String")}}类型和 {{jsxref("Symbol")}} 类型的属性都会被拷贝。</p>
+
+<p>在出现错误的情况下,例如,如果属性不可写,会引发{{jsxref("TypeError")}},如果在引发错误之前添加了任何属性,则可以更改<code>target</code>对象。</p>
+
+<div class="blockIndicator note">
+<p>注意,<code>Object.assign</code> 不会在那些<code>source</code>对象值为 {{jsxref("null")}} 或 {{jsxref("undefined")}} 的时候抛出错误。</p>
+</div>
+
+<h2 id="Polyfill_2">Polyfill</h2>
+
+<p>这个 <a href="https://wiki.developer.mozilla.org/en-US/docs/Glossary/Polyfill">polyfill</a> 不支持 symbol 属性, 由于 ES5 中本来就不存在 symbols :</p>
+
+<pre class="notranslate">if (typeof Object.assign !== 'function') {
+ // Must be writable: true, enumerable: false, configurable: true
+ Object.defineProperty(Object, "assign", {
+ value: function assign(target, varArgs) { // .length of function is 2
+ 'use strict';
+ if (target === null || target === undefined) {
+ throw new TypeError('Cannot convert undefined or null to object');
+ }
+
+ var to = Object(target);
+
+ for (var index = 1; index &lt; arguments.length; index++) {
+ var nextSource = arguments[index];
+
+ if (nextSource !== null &amp;&amp; nextSource !== undefined) {
+ for (var nextKey in nextSource) {
+ // Avoid bugs when hasOwnProperty is shadowed
+ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
+ to[nextKey] = nextSource[nextKey];
+ }
+ }
+ }
+ }
+ return to;
+ },
+ writable: true,
+ configurable: true
+ });
+}</pre>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<h3 id="Example_Cloning_an_object" name="Example:_Cloning_an_object">复制一个对象</h3>
+
+<pre class="brush: js notranslate">const obj = { a: 1 };
+const copy = Object.assign({}, obj);
+console.log(copy); // { a: 1 }
+</pre>
+
+<h3 id="Deep_Clone" name="Deep_Clone">深拷贝问题</h3>
+
+<p>针对深拷贝,需要使用其他办法,因为 <code>Object.assign()</code>拷贝的是(可枚举)属性值。</p>
+
+<p>假如源值是一个对象的引用,它仅仅会复制其引用值。</p>
+
+<pre class="brush: js notranslate">const log = console.log;
+
+function test() {
+ 'use strict';
+ let obj1 = { a: 0 , b: { c: 0}};
+ let obj2 = Object.assign({}, obj1);
+ log(JSON.stringify(obj2));
+  // { a: 0, b: { c: 0}}
+
+ obj1.a = 1;
+ log(JSON.stringify(obj1));
+  // { a: 1, b: { c: 0}}
+ log(JSON.stringify(obj2));
+  // { a: 0, b: { c: 0}}
+
+ obj2.a = 2;
+ log(JSON.stringify(obj1));
+  // { a: 1, b: { c: 0}}
+ log(JSON.stringify(obj2));
+  // { a: 2, b: { c: 0}}
+
+ obj2.b.c = 3;
+ log(JSON.stringify(obj1));
+  // { a: 1, b: { c: 3}}
+ log(JSON.stringify(obj2));
+  // { a: 2, b: { c: 3}}
+
+ // Deep Clone
+ obj1 = { a: 0 , b: { c: 0}};
+ let obj3 = JSON.parse(JSON.stringify(obj1));
+ obj1.a = 4;
+ obj1.b.c = 4;
+ log(JSON.stringify(obj3));
+ // { a: 0, b: { c: 0}}
+}
+
+test();
+</pre>
+
+<h3 id="Example_Merging_objects" name="Example:_Merging_objects">合并对象</h3>
+
+<pre class="brush: js notranslate">const o1 = { a: 1 };
+const o2 = { b: 2 };
+const o3 = { c: 3 };
+
+const obj = Object.assign(o1, o2, o3);
+console.log(obj); // { a: 1, b: 2, c: 3 }
+console.log(o1); // { a: 1, b: 2, c: 3 }, 注意目标对象自身也会改变。
+</pre>
+
+<h3 id="合并具有相同属性的对象">合并具有相同属性的对象</h3>
+
+<pre class="brush: js notranslate">const o1 = { a: 1, b: 1, c: 1 };
+const o2 = { b: 2, c: 2 };
+const o3 = { c: 3 };
+
+const obj = Object.assign({}, o1, o2, o3);
+console.log(obj); // { a: 1, b: 2, c: 3 }</pre>
+
+<p>属性被后续参数中具有相同属性的其他对象覆盖。</p>
+
+<h3 id="Example_Symbol_properties" name="Example:_Symbol_properties">拷贝 symbol 类型的属性</h3>
+
+<pre class="brush: js notranslate">const o1 = { a: 1 };
+const o2 = { [Symbol('foo')]: 2 };
+
+const obj = Object.assign({}, o1, o2);
+console.log(obj); // { a : 1, [Symbol("foo")]: 2 } (cf. bug 1207182 on Firefox)
+Object.getOwnPropertySymbols(obj); // [Symbol(foo)]</pre>
+
+<h3 id="Example_Only_own_enumerable_properties" name="Example:_Only_own_enumerable_properties">继承属性和不可枚举属性是不能拷贝的</h3>
+
+<pre class="brush: js notranslate">const obj = Object.create({foo: 1}, { // foo 是个继承属性。
+ bar: {
+ value: 2 // bar 是个不可枚举属性。
+ },
+ baz: {
+ value: 3,
+ enumerable: true // baz 是个自身可枚举属性。
+ }
+});
+
+const copy = Object.assign({}, obj);
+console.log(copy); // { baz: 3 }
+</pre>
+
+<h3 id="Example_Primitives" name="Example:_Primitives">原始类型会被包装为对象</h3>
+
+<pre class="brush: js notranslate">const v1 = "abc";
+const v2 = true;
+const v3 = 10;
+const v4 = Symbol("foo")
+
+const obj = Object.assign({}, v1, null, v2, undefined, v3, v4);
+// 原始类型会被包装,null 和 undefined 会被忽略。
+// 注意,只有字符串的包装对象才可能有自身可枚举属性。
+console.log(obj); // { "0": "a", "1": "b", "2": "c" }</pre>
+
+<h3 id="Example_Exceptions" name="Example:_Exceptions">异常会打断后续拷贝任务</h3>
+
+<pre class="brush: js notranslate">const target = Object.defineProperty({}, "foo", {
+ value: 1,
+ writable: false
+}); // target 的 foo 属性是个只读属性。
+
+Object.assign(target, {bar: 2}, {foo2: 3, foo: 3, foo3: 3}, {baz: 4});
+// TypeError: "foo" is read-only
+// 注意这个异常是在拷贝第二个源对象的第二个属性时发生的。
+
+console.log(target.bar); // 2,说明第一个源对象拷贝成功了。
+console.log(target.foo2); // 3,说明第二个源对象的第一个属性也拷贝成功了。
+console.log(target.foo); // 1,只读属性不能被覆盖,所以第二个源对象的第二个属性拷贝失败了。
+console.log(target.foo3); // undefined,异常之后 assign 方法就退出了,第三个属性是不会被拷贝到的。
+console.log(target.baz); // undefined,第三个源对象更是不会被拷贝到的。
+</pre>
+
+<h3 id="Example_Copy_accessors" name="Example:_Copy_accessors">拷贝访问器</h3>
+
+<pre class="brush: js notranslate">const obj = {
+ foo: 1,
+ get bar() {
+ return 2;
+ }
+};
+
+let copy = Object.assign({}, obj);
+console.log(copy); // { foo: 1, bar: 2 } copy.bar的值来自obj.bar的getter函数的返回值
+
+// 下面这个函数会拷贝所有自有属性的属性描述符
+function completeAssign(target, ...sources) {
+ sources.forEach(source =&gt; {
+ let descriptors = Object.keys(source).reduce((descriptors, key) =&gt; {
+ descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
+ return descriptors;
+ }, {});
+
+  // Object.assign 默认也会拷贝可枚举的Symbols
+ Object.getOwnPropertySymbols(source).forEach(sym =&gt; {
+ let descriptor = Object.getOwnPropertyDescriptor(source, sym);
+ if (descriptor.enumerable) {
+ descriptors[sym] = descriptor;
+ }
+ });
+ Object.defineProperties(target, descriptors);
+ });
+ return target;
+}
+
+copy = completeAssign({}, obj);
+console.log(copy);
+// { foo:1, get bar() { return 2 } }
+</pre>
+
+<h2 id="Polyfill" name="Polyfill">Polyfill</h2>
+
+<p>此{{Glossary("Polyfill","polyfill")}}不支持 symbol 属性,因为ES5 中根本没有 symbol :</p>
+
+<pre class="brush: js notranslate">if (typeof Object.assign != 'function') {
+ // Must be writable: true, enumerable: false, configurable: true
+ Object.defineProperty(Object, "assign", {
+ value: function assign(target, varArgs) { // .length of function is 2
+ 'use strict';
+ if (target == null) { // TypeError if undefined or null
+ throw new TypeError('Cannot convert undefined or null to object');
+ }
+
+ let to = Object(target);
+
+ for (var index = 1; index &lt; arguments.length; index++) {
+ var nextSource = arguments[index];
+
+ if (nextSource != null) { // Skip over if undefined or null
+ for (let nextKey in nextSource) {
+ // Avoid bugs when hasOwnProperty is shadowed
+ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
+ to[nextKey] = nextSource[nextKey];
+ }
+ }
+ }
+ }
+ return to;
+ },
+ writable: true,
+ configurable: true
+ });
+}</pre>
+
+<h2 id="Specifications" name="Specifications">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范名称</th>
+ <th scope="col">规范状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.assign', 'Object.assign')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.assign', 'Object.assign')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.assign")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.defineProperties()")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Enumerability_and_ownership_of_properties">属性的可枚举性和所有权</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html
new file mode 100644
index 0000000000..470072ebe7
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html
@@ -0,0 +1,235 @@
+---
+title: Object.prototype.constructor
+slug: Web/JavaScript/Reference/Global_Objects/Object/constructor
+tags:
+ - JavaScript
+ - Object
+ - Property
+ - Prototype
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/constructor
+---
+<p>{{JSRef}}</p>
+
+<p>返回创建实例对象的 {{jsxref("Object")}} 构造函数的引用。注意,此属性的值是对函数本身的引用,而不是一个包含函数名称的字符串。对原始类型来说,如<code>1</code>,<code>true</code>和<code>"test"</code>,该值只可读。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>所有对象都会从它的原型上继承一个 <code>constructor</code> 属性:</p>
+
+<pre class="brush: js">var o = {};
+o.constructor === Object; // true
+
+var o = new Object;
+o.constructor === Object; // true
+
+var a = [];
+a.constructor === Array; // true
+
+var a = new Array;
+a.constructor === Array // true
+
+var n = new Number(3);
+n.constructor === Number; // true</pre>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<h3 id="Example_Displaying_the_constructor_of_an_object" name="Example:_Displaying_the_constructor_of_an_object">打印一个对象的构造函数</h3>
+
+<p>以下示例创建一个原型,<code>Tree</code>,以及该类型的对象,即<code>theTree</code>。 然后打印<code>theTree</code>对象的<code>constructor</code>属性。</p>
+
+<pre class="brush:js">function Tree(name) {
+ this.name = name;
+}
+
+var theTree = new Tree("Redwood");
+console.log( "theTree.constructor is " + theTree.constructor );</pre>
+
+<p>打印输出:</p>
+
+<pre class="brush:js">theTree.constructor is function Tree(name) {
+ this.name = name;
+}</pre>
+
+<h3 id="Example_Changing_the_constructor_of_an_object" name="Example:_Changing_the_constructor_of_an_object">改变对象的 constructor</h3>
+
+<p>下面的例子展示了如何修改基本类型对象的 <code>constructor</code> 属性的值。只有 <code>true</code>, <code>1</code> 和 <code>"test"</code> 的不受影响,因为创建他们的是只读的原生构造函数(native constructors)。这个例子也说明了依赖一个对象的 <code>constructor</code> 属性并不安全。</p>
+
+<pre class="brush:js">function Type() { };
+
+var types = [
+ new Array,
+ [],
+ new Boolean,
+ true, // remains unchanged
+ new Date,
+ new Error,
+ new Function,
+ function(){},
+ Math,
+ new Number,
+ 1, // remains unchanged
+ new Object,
+ {},
+ new RegExp,
+ /(?:)/,
+ new String,
+ "test" // remains unchanged
+];
+
+for(var i = 0; i &lt; types.length; i++) {
+ types[i].constructor = Type;
+ types[i] = [ types[i].constructor, types[i] instanceof Type, types[i].toString() ];
+};
+
+console.log( types.join("\n") );
+</pre>
+
+<p>此示例显示以下输出:</p>
+
+<pre class="brush: js">function Type() {},false,
+function Type() {},false,
+function Type() {},false,false
+function Boolean() {
+ [native code]
+},false,true
+function Type() {},false,Mon Sep 01 2014 16:03:49 GMT+0600
+function Type() {},false,Error
+function Type() {},false,function anonymous() {
+
+}
+function Type() {},false,function () {}
+function Type() {},false,[object Math]
+function Type() {},false,0
+function Number() {
+ [native code]
+},false,1
+function Type() {},false,[object Object]
+function Type() {},false,[object Object]
+function Type() {},false,/(?:)/
+function Type() {},false,/(?:)/
+function Type() {},false,
+function String() {
+ [native code]
+},false,test
+</pre>
+
+
+
+<h3 id="改变函数的_constructor">改变函数的 constructor</h3>
+
+<p>大多数情况下,此属性用于定义一个构造函数,并使用<strong>new</strong>和继承原型链进一步调用它。</p>
+
+<pre class="brush: js">function Parent() {}
+Parent.prototype.parentMethod = function parentMethod() {};
+
+function Child() {}
+Child.prototype = Object.create(Parent.prototype); // re-define child prototype to Parent prototype
+
+Child.prototype.constructor = Child; // return original constructor to Child</pre>
+
+<p>但为什么我们需要在这里执行最后一行?很不幸正确答案是 - 看情况而定。</p>
+
+<p>让我们来尝试定义在哪些情况下,重新分配原始构造函数会发挥重要作用,以及在什么时候它就是额外的未使用的(无效的)代码行。</p>
+
+<p>试想下一种情况:该对象具有创建自身的<strong>create</strong>方法。</p>
+
+<pre class="brush: js">function Parent() {};
+function CreatedConstructor() {}
+
+CreatedConstructor.prototype = Object.create(Parent.prototype);
+
+CreatedConstructor.prototype.create = function create() {
+ return new this.constructor();
+}
+
+new CreatedConstructor().create().create(); // error undefined is not a function since constructor === Parent
+</pre>
+
+<p>在上面的示例中,将显示异常,因为构造函数链接到Parent。</p>
+
+<p>为了避免它,只需分配您将要使用的必要构造函数。</p>
+
+<pre class="brush: js">function Parent() {};
+function CreatedConstructor() {}
+
+CreatedConstructor.prototype = Object.create(Parent.prototype);
+CreatedConstructor.prototype.constructor = CreatedConstructor; // set right constructor for further using
+
+CreatedConstructor.prototype.create = function create() {
+ return new this.constructor();
+}
+
+new CreatedConstructor().create().create(); // it's pretty fine</pre>
+
+<p>好的,现在很清楚为什么更改构造函数会很有用。</p>
+
+<p>让我们再考虑一个案例。</p>
+
+<pre class="brush: js">function ParentWithStatic() {}
+
+ParentWithStatic.startPosition = { x: 0, y:0 };
+ParentWithStatic.getStartPosition = function getStartPosition() {
+ return this.startPosition;
+}
+
+function Child(x, y) {
+ this.position = {
+ x: x,
+ y: y
+ };
+}
+
+Child.prototype = Object.create(ParentWithStatic.prototype);
+Child.prototype.constructor = Child;
+
+Child.prototype.getOffsetByInitialPosition = function getOffsetByInitialPosition() {
+ var position = this.position;
+ var startPosition = this.constructor.getStartPosition(); // error undefined is not a function, since the constructor is Child
+
+ return {
+ offsetX: startPosition.x - position.x,
+ offsetY: startPosition.y - position.y
+ }
+};</pre>
+
+<p>对于此示例,我们需要保持父构造函数继续正常工作。</p>
+
+<p><strong>总结</strong>:手动设置或更新构造函数可能会导致不同且有时令人困惑的后果。为了防止它,只需在每个特定情况下定义构造函数的角色。在大多数情况下,不使用构造函数,并且不需要重新分配构造函数。</p>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.1.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.1', 'Object.prototype.constructor')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.constructor', 'Object.prototype.constructor')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.constructor', 'Object.prototype.constructor')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.constructor")}}</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/count/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/count/index.html
new file mode 100644
index 0000000000..c7dfb12f2b
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/count/index.html
@@ -0,0 +1,88 @@
+---
+title: Object.prototype.__count__
+slug: Web/JavaScript/Reference/Global_Objects/Object/count
+tags:
+ - JavaScript
+ - Object
+ - Obsolete
+ - Property
+ - Prototype
+translation_of: Archive/Web/JavaScript/Object.count
+---
+<div>{{JSRef}} {{obsolete_header("2")}}</div>
+
+<p> <strong><code>__count__</code></strong> 属性曾经用来存放对象的可枚举的属性的个数,但是已经被废除。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.__count__</code></pre>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">{ 1: 1 }.__count__ // 1
+[].__count__ // 0
+[1].__count__ // 1
+[1, /* hole */, 2, 3].__count__ // 3
+</pre>
+
+<h2 id="详细说明">详细说明</h2>
+
+<p>无需详细说明</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="更多请参看">更多请参看</h2>
+
+<ul>
+ <li><a class="external" href="http://whereswalden.com/2010/04/06/more-changes-coming-to-spidermonkey-the-magical-__count__-property-of-objects-is-being-removed/">[Blog post] More changes coming to SpiderMonkey: the magical __count__ property is being removed</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html
new file mode 100644
index 0000000000..4cc48defc5
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html
@@ -0,0 +1,227 @@
+---
+title: Object.create()
+slug: Web/JavaScript/Reference/Global_Objects/Object/create
+tags:
+ - ECMAScript5
+ - JavaScript
+ - Method
+ - Object
+ - Reference
+ - polyfill
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/create
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Object.create()</code></strong>方法创建一个新对象,使用现有的对象来提供新创建的对象的__proto__。 (请打开浏览器控制台以查看运行结果。)</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-create.html", "taller")}}</div>
+
+<div class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</div>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="notranslate">Object.create(<var>proto,[</var><var>propertiesObject</var>])</pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>proto</code></dt>
+ <dd>新创建对象的原型对象。</dd>
+ <dt><code>propertiesObject</code></dt>
+ <dd>可选。需要传入一个对象,该对象的属性类型参照{{jsxref("Object.defineProperties()")}}的第二个参数。如果该参数被指定且不为 {{jsxref("undefined")}},该传入对象的自有可枚举属性(即其自身定义的属性,而不是其原型链上的枚举属性)将为新创建的对象添加指定的属性值和对应的属性描述符。</dd>
+</dl>
+
+<h3 id="Parameters" name="Parameters">返回值</h3>
+
+<p>一个新对象,带着指定的原型对象和属性。</p>
+
+<h3 id="Description" name="Description">例外</h3>
+
+<p>如果<code>propertiesObject</code>参数是 {{jsxref("null")}} 或非原始包装对象,则抛出一个 {{jsxref("TypeError")}} 异常。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<h3 id="用_Object.create实现类式继承">用 <code>Object.create</code>实现类式继承</h3>
+
+<p>下面的例子演示了如何使用<code>Object.create()</code>来实现类式继承。这是一个所有版本JavaScript都支持的单继承。</p>
+
+<pre class="brush: js notranslate">// Shape - 父类(superclass)
+function Shape() {
+ this.x = 0;
+ this.y = 0;
+}
+
+// 父类的方法
+Shape.prototype.move = function(x, y) {
+ this.x += x;
+ this.y += y;
+ console.info('Shape moved.');
+};
+
+// Rectangle - 子类(subclass)
+function Rectangle() {
+ Shape.call(this); // call super constructor.
+}
+
+// 子类续承父类
+Rectangle.prototype = Object.create(Shape.prototype);
+Rectangle.prototype.constructor = Rectangle;
+
+var rect = new Rectangle();
+
+console.log('Is rect an instance of Rectangle?',
+ rect instanceof Rectangle); // true
+console.log('Is rect an instance of Shape?',
+ rect instanceof Shape); // true
+rect.move(1, 1); // Outputs, 'Shape moved.'</pre>
+
+<p>如果你希望能继承到多个对象,则可以使用<span class="short_text" id="result_box" lang="zh-CN"><span>混入的方式。</span></span></p>
+
+<pre class="brush: js notranslate">function MyClass() {
+ SuperClass.call(this);
+ OtherSuperClass.call(this);
+}
+
+// 继承一个类
+MyClass.prototype = Object.create(SuperClass.prototype);
+// 混合其它
+Object.assign(MyClass.prototype, OtherSuperClass.prototype);
+// 重新指定constructor
+MyClass.prototype.constructor = MyClass;
+
+MyClass.prototype.myMethod = function() {
+ // do a thing
+};
+</pre>
+
+<p><a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/assign">Object.assign</a> 会把  <code>OtherSuperClass</code>原型上的函数拷贝到 <code>MyClass</code>原型上,使 MyClass 的所有实例都可用 OtherSuperClass 的方法。Object.assign 是在 ES2015 引入的,且可用<a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill"> polyfilled</a>。要支持旧浏览器的话,可用使用 <a href="https://api.jquery.com/jQuery.extend/">jQuery.extend()</a> 或者 <a href="https://lodash.com/docs/#assign">_.assign()</a>。</p>
+
+<h3 id="使用_Object.create_的_propertyObject参数">使用 <code>Object.create</code> 的 <code>propertyObject</code>参数</h3>
+
+<pre class="brush: js notranslate">var o;
+
+// 创建一个原型为null的空对象
+o = Object.create(null);
+
+
+o = {};
+// 以字面量方式创建的空对象就相当于:
+o = Object.create(Object.prototype);
+
+
+o = Object.create(Object.prototype, {
+ // foo会成为所创建对象的数据属性
+ foo: {
+  writable:true,
+  configurable:true,
+  value: "hello"
+  },
+ // bar会成为所创建对象的访问器属性
+ bar: {
+ configurable: false,
+ get: function() { return 10 },
+ set: function(value) {
+  console.log("Setting `o.bar` to", value);
+  }
+ }
+});
+
+
+function Constructor(){}
+o = new Constructor();
+// 上面的一句就相当于:
+o = Object.create(Constructor.prototype);
+// 当然,如果在Constructor函数中有一些初始化代码,Object.create不能执行那些代码
+
+
+// 创建一个以另一个空对象为原型,且拥有一个属性p的对象
+o = Object.create({}, { p: { value: 42 } })
+
+// 省略了的属性特性默认为false,所以属性p是不可写,不可枚举,不可配置的:
+o.p = 24
+o.p
+//42
+
+o.q = 12
+for (var prop in o) {
+ console.log(prop)
+}
+//"q"
+
+delete o.p
+//false
+
+//创建一个可写的,可枚举的,可配置的属性p
+o2 = Object.create({}, {
+ p: {
+ value: 42,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ }
+});</pre>
+
+<h2 id="Polyfill" style="line-height: 24px;">Polyfill</h2>
+
+<p>这个 polyfill 涵盖了主要的应用场景,它创建一个已经选择了原型的新对象,但没有把第二个参数考虑在内。</p>
+
+<p>请注意,尽管在 ES5 中 <code>Object.create</code>支持设置为<code>[[Prototype]]</code>为<code>null</code>,但因为那些ECMAScript5以前版本限制,此 polyfill 无法支持该特性。</p>
+
+<pre class="brush: js notranslate">if (typeof Object.create !== "function") {
+ Object.create = function (proto, propertiesObject) {
+ if (typeof proto !== 'object' &amp;&amp; typeof proto !== 'function') {
+ throw new TypeError('Object prototype may only be an Object: ' + proto);
+ } else if (proto === null) {
+ throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.");
+ }
+
+ if (typeof propertiesObject !== 'undefined') throw new Error("This browser's implementation of Object.create is a shim and doesn't support a second argument.");
+
+ function F() {}
+ F.prototype = proto;
+
+ return new F();
+ };
+}</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.5', 'Object.create')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.5.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-object.create', 'Object.create')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.create', 'Object.create')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.create")}}</p>
+
+<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.defineProperty")}}</li>
+ <li>{{jsxref("Object.defineProperties")}}</li>
+ <li>{{jsxref("Object.prototype.isPrototypeOf")}}</li>
+ <li>John Resig's post on <a class="external external-icon" href="http://ejohn.org/blog/objectgetprototypeof/" style="white-space: pre-line;" title="http://ejohn.org/blog/objectgetprototypeof/">getPrototypeOf</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html
new file mode 100644
index 0000000000..c36b799695
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html
@@ -0,0 +1,183 @@
+---
+title: Object.defineProperties()
+slug: Web/JavaScript/Reference/Global_Objects/Object/defineProperties
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/defineProperties
+---
+<p>{{JSRef}}</p>
+
+<p><strong><code>Object.defineProperties()</code> </strong>方法直接在一个对象上定义新的属性或修改现有属性,并返回该对象。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre><code>Object.defineProperties(<var>obj</var>, <var>props</var>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>在其上定义或修改属性的对象。</dd>
+ <dt><code>props</code></dt>
+ <dd>要定义其可枚举属性或修改的属性描述符的对象。对象中存在的属性描述符主要有两种:数据描述符和访问器描述符(更多详情,请参阅{{jsxref("Object.defineProperty()")}})。描述符具有以下键:</dd>
+ <dd>
+ <dl>
+ <dt><code>configurable</code></dt>
+ <dd><code>true</code> 当且仅当该属性描述符的类型可以被改变并且该属性可以从对应对象中删除。<br>
+ <strong>默认为 <code>false</code></strong></dd>
+ <dt><code>enumerable</code></dt>
+ <dd><code>true</code> 当且仅当在枚举相应对象上的属性时该属性显现。<br>
+ <strong>默认为 <code>false</code></strong></dd>
+ </dl>
+
+ <dl>
+ <dt><code>value</code></dt>
+ <dd>与属性关联的值。可以是任何有效的JavaScript值(数字,对象,函数等)。<br>
+ <strong>默认为 {{jsxref("undefined")}}.</strong></dd>
+ <dt><code>writable</code></dt>
+ <dd><code>true</code>当且仅当与该属性相关联的值可以用{{jsxref("Operators/Assignment_Operators", "assignment operator", "", 1)}}改变时。<br>
+ <strong>默认为 <code>false</code></strong></dd>
+ </dl>
+
+ <dl>
+ <dt><code>get</code></dt>
+ <dd>作为该属性的 getter 函数,如果没有 getter 则为{{jsxref("undefined")}}。函数返回值将被用作属性的值。<br>
+ <strong>默认为 {{jsxref("undefined")}}</strong></dd>
+ <dt><code>set</code></dt>
+ <dd>作为属性的 setter 函数,如果没有 setter 则为{{jsxref("undefined")}}。函数将仅接受参数赋值给该属性的新值。<br>
+ <strong>默认为 {{jsxref("undefined")}}</strong></dd>
+ </dl>
+ </dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>传递给函数的对象。</p>
+
+<h2 id="描述">描述</h2>
+
+<p><code>Object.defineProperties</code>本质上定义了<code>obj</code> 对象上<code>props</code>的可枚举属性相对应的所有属性。</p>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush: js">var obj = {};
+Object.defineProperties(obj, {
+ 'property1': {
+ value: true,
+ writable: true
+ },
+ 'property2': {
+ value: 'Hello',
+ writable: false
+ }
+ // etc. etc.
+});</pre>
+
+<h2 id="Polyfill">Polyfill</h2>
+
+<p>假设一个原始的执行环境,所有的名称和属性都引用它们的初始值,<code>Object.defineProperties</code>几乎完全等同于(注意<code>isCallable</code>中的注释)以下JavaScript中的重新实现:</p>
+
+<pre class="brush: js">function defineProperties(obj, properties) {
+ function convertToDescriptor(desc) {
+ function hasProperty(obj, prop) {
+ return Object.prototype.hasOwnProperty.call(obj, prop);
+ }
+
+ function isCallable(v) {
+ // NB: modify as necessary if other values than functions are callable.
+ return typeof v === 'function';
+ }
+
+ if (typeof desc !== 'object' || desc === null)
+ throw new TypeError('bad desc');
+
+ var d = {};
+
+ if (hasProperty(desc, 'enumerable'))
+ d.enumerable = !!desc.enumerable;
+ if (hasProperty(desc, 'configurable'))
+ d.configurable = !!desc.configurable;
+ if (hasProperty(desc, 'value'))
+ d.value = desc.value;
+ if (hasProperty(desc, 'writable'))
+ d.writable = !!desc.writable;
+ if (hasProperty(desc, 'get')) {
+ var g = desc.get;
+
+ if (!isCallable(g) &amp;&amp; typeof g !== 'undefined')
+ throw new TypeError('bad get');
+ d.get = g;
+ }
+ if (hasProperty(desc, 'set')) {
+ var s = desc.set;
+ if (!isCallable(s) &amp;&amp; typeof s !== 'undefined')
+ throw new TypeError('bad set');
+ d.set = s;
+ }
+
+ if (('get' in d || 'set' in d) &amp;&amp; ('value' in d || 'writable' in d))
+ throw new TypeError('identity-confused descriptor');
+
+ return d;
+ }
+
+ if (typeof obj !== 'object' || obj === null)
+ throw new TypeError('bad obj');
+
+ properties = Object(properties);
+
+ var keys = Object.keys(properties);
+ var descs = [];
+
+ for (var i = 0; i &lt; keys.length; i++)
+ descs.push([keys[i], convertToDescriptor(properties[keys[i]])]);
+
+ for (var i = 0; i &lt; descs.length; i++)
+ Object.defineProperty(obj, descs[i][0], descs[i][1]);
+
+ return obj;
+}</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.7', 'Object.defineProperties')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.defineproperties', 'Object.defineProperties')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.defineproperties', 'Object.defineProperties')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.defineProperties")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li>{{jsxref("Object.keys()")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Enumerability_and_ownership_of_properties">属性的可枚举性和所有权</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html
new file mode 100644
index 0000000000..beaca31a6a
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html
@@ -0,0 +1,545 @@
+---
+title: Object.defineProperty()
+slug: Web/JavaScript/Reference/Global_Objects/Object/defineProperty
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - JavaScript 1.8.5
+ - Method
+ - Object
+ - 对象
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/defineProperty
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.defineProperty()</strong></code> 方法会直接在一个对象上定义一个新属性,或者修改一个对象的现有属性,并返回此对象。</p>
+
+<div class="note">
+<p><strong>备注:</strong>应当直接在 {{jsxref("Object")}} 构造器对象上调用此方法,而不是在任意一个 <code>Object</code> 类型的实例上调用。</p>
+</div>
+
+<div>{{EmbedInteractiveExample("pages/js/object-defineproperty.html")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate">Object.defineProperty(<var>obj</var>, <var>prop</var>, <var>descriptor</var>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code><var>obj</var></code></dt>
+ <dd>要定义属性的对象。</dd>
+ <dt><code><var>prop</var></code></dt>
+ <dd>要定义或修改的属性的名称或 {{jsxref("Symbol")}} 。</dd>
+ <dt><code><var>descriptor</var></code></dt>
+ <dd>要定义或修改的属性描述符。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>被传递给函数的对象。</p>
+
+<div class="note">
+<p>在ES6中,由于 Symbol类型的特殊性,用Symbol类型的值来做对象的key与常规的定义或修改不同,而<code>Object.defineProperty</code> 是定义key为Symbol的属性的方法之一。</p>
+</div>
+
+<h2 id="描述">描述</h2>
+
+<p>该方法允许精确地添加或修改对象的属性。通过赋值操作添加的普通属性是可枚举的,在枚举对象属性时会被枚举到({{jsxref("Statements/for...in", "for...in")}} 或 {{jsxref("Object.keys")}}<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys"> </a>方法),可以改变这些属性的值,也可以{{jsxref("Operators/delete", "删除")}}这些属性。这个方法允许修改默认的额外选项(或配置)。默认情况下,使用 <code>Object.defineProperty()</code> 添加的属性值是不可修改(immutable)的。</p>
+
+<p>对象里目前存在的属性描述符有两种主要形式:<em>数据描述符</em>和<em>存取描述符</em>。<em>数据描述符</em>是一个具有值的属性,该值可以是可写的,也可以是不可写的。<em>存取描述符</em>是由 getter 函数和 setter 函数所描述的属性。一个描述符只能是这两者其中之一;不能同时是两者。</p>
+
+<p>这两种描述符都是对象。它们共享以下可选键值(默认值是指在使用 <code>Object.defineProperty()</code> 定义属性时的默认值):</p>
+
+<dl>
+ <dt><code>configurable</code></dt>
+ <dd>当且仅当该属性的 <code>configurable</code> 键值为 <code>true</code> 时,该属性的描述符才能够被改变,同时该属性也能从对应的对象上被删除。<br>
+ <strong>默认为 </strong> <strong><code>false</code></strong>。</dd>
+ <dt><code>enumerable</code></dt>
+ <dd>当且仅当该属性的 <code>enumerable</code> 键值为 <code>true</code> 时,该属性才会出现在对象的枚举属性中。<br>
+ <strong>默认为 <code>false</code></strong>。</dd>
+</dl>
+
+<p>数据描述符还具有以下可选键值:</p>
+
+<dl>
+ <dt><code>value</code></dt>
+ <dd>该属性对应的值。可以是任何有效的 JavaScript 值(数值,对象,函数等)。<br>
+ <strong>默认为 {{jsxref("undefined")}}</strong>。</dd>
+ <dt><code>writable</code></dt>
+ <dd>当且仅当该属性的 <code>writable</code> 键值为 <code>true</code> 时,属性的值,也就是上面的 <code>value</code>,才能被{{jsxref("Operators/Assignment_Operators", "赋值运算符")}}改变。<br>
+ <strong>默认为 <code>false</code>。</strong></dd>
+</dl>
+
+<p>存取描述符还具有以下可选键值:</p>
+
+<dl>
+ <dt><code>get</code></dt>
+ <dd>属性的 getter 函数,如果没有 getter,则为 <code>undefined</code>。当访问该属性时,会调用此函数。执行时不传入任何参数,但是会传入 <code>this</code> 对象(由于继承关系,这里的<code>this</code>并不一定是定义该属性的对象)。该函数的返回值会被用作属性的值。<br>
+ <strong>默认为 {{jsxref("undefined")}}</strong>。</dd>
+ <dt><code>set</code></dt>
+ <dd>属性的 setter 函数,如果没有 setter,则为 <code>undefined</code>。当属性值被修改时,会调用此函数。该方法接受一个参数(也就是被赋予的新值),会传入赋值时的 <code>this</code> 对象。<br>
+ <strong>默认为 {{jsxref("undefined")}}</strong>。</dd>
+</dl>
+
+<h4 id="描述符默认值汇总">描述符默认值汇总</h4>
+
+<ul>
+ <li>拥有布尔值的键 <code>configurable</code>、<code>enumerable</code> 和 <code>writable</code> 的默认值都是 <span style="font-family: courier new,andale mono,monospace; line-height: 1.5;"><code>false</code></span>。</li>
+ <li>属性值和函数的键 <code>value</code>、<code>get</code> 和 <code>set</code> 字段的默认值为 <code>undefined</code>。</li>
+</ul>
+
+<h4 id="描述符可拥有的键值">描述符可拥有的键值</h4>
+
+<dl>
+ <dt>
+ <table class="standard-table">
+ <caption></caption>
+ <tbody>
+ <tr>
+ <td></td>
+ <td><code>configurable</code></td>
+ <td><code>enumerable</code></td>
+ <td><code>value</code></td>
+ <td><code>writable</code></td>
+ <td><code>get</code></td>
+ <td><code>set</code></td>
+ </tr>
+ <tr>
+ <td>数据描述符</td>
+ <td>可以</td>
+ <td>可以</td>
+ <td>可以</td>
+ <td>可以</td>
+ <td>不可以</td>
+ <td>不可以</td>
+ </tr>
+ <tr>
+ <td>存取描述符</td>
+ <td>可以</td>
+ <td>可以</td>
+ <td>不可以</td>
+ <td>不可以</td>
+ <td>可以</td>
+ <td>可以</td>
+ </tr>
+ </tbody>
+ </table>
+ </dt>
+</dl>
+
+<p>如果一个描述符不具有 <code>value</code>、<code>writable</code>、<code>get</code> 和 <code>set</code> 中的任意一个键,那么它将被认为是一个数据描述符。如果一个描述符同时拥有 <code>value</code> 或 <code>writable</code> 和 <code>get</code> 或 <code>set</code> 键,则会产生一个异常。</p>
+
+<p>记住,这些选项不一定是自身属性,也要考虑继承来的属性。为了确认保留这些默认值,在设置之前,可能要冻结 {{jsxref("Object.prototype")}},明确指定所有的选项,或者通过 {{jsxref("Object.create", "Object.create(null)")}} 将 {{jsxref("Object.prototype.__proto__", "__proto__")}} 属性指向 {{jsxref("null")}}。</p>
+
+<pre class="brush: js notranslate">// 使用 __proto__
+var obj = {};
+var descriptor = Object.create(null); // 没有继承的属性
+// 默认没有 enumerable,没有 configurable,没有 writable
+descriptor.value = 'static';
+Object.defineProperty(obj, 'key', descriptor);
+
+// 显式
+Object.defineProperty(obj, "key", {
+ enumerable: false,
+ configurable: false,
+ writable: false,
+ value: "static"
+});
+
+// 循环使用同一对象
+function withValue(value) {
+ var d = withValue.d || (
+ withValue.d = {
+ enumerable: false,
+ writable: false,
+ configurable: false,
+ value: null
+ }
+ );
+ d.value = value;
+ return d;
+}
+// ... 并且 ...
+Object.defineProperty(obj, "key", withValue("static"));
+
+// 如果 freeze 可用, 防止后续代码添加或删除对象原型的属性
+// (value, get, set, enumerable, writable, configurable)
+(Object.freeze||Object)(Object.prototype);</pre>
+
+<h2 id="示例">示例</h2>
+
+<p>如果你想了解如何使用 <code>Object.defineProperty</code> 方法和<em>类二进制标记</em>语法<span style="line-height: 1.5;">,可以看看</span>这些<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty/Additional_examples" style="line-height: 1.5;">额外示例</a><span style="line-height: 1.5;">。</span></p>
+
+<h3 id="创建属性">创建属性</h3>
+
+<p>如果对象中不存在指定的属性,<span style="font-family: courier new,andale mono,monospace; line-height: 1.5;"><code>Object.defineProperty()</code></span> 会创建这个属性。当描述符中省略某些字段时,这些字段将使用它们的默认值。</p>
+
+<pre class="brush: js notranslate">var o = {}; // 创建一个新对象
+
+// 在对象中添加一个属性与数据描述符的示例
+Object.defineProperty(o, "a", {
+ value : 37,
+ writable : true,
+ enumerable : true,
+ configurable : true
+});
+
+// 对象 o 拥有了属性 a,值为 37
+
+// 在对象中添加一个设置了存取描述符属性的示例
+var bValue = 38;
+Object.defineProperty(o, "b", {
+ // 使用了方法名称缩写(ES2015 特性)
+ // 下面两个缩写等价于:
+ // get : function() { return bValue; },
+ // set : function(newValue) { bValue = newValue; },
+ get() { return bValue; },
+ set(newValue) { bValue = newValue; },
+ enumerable : true,
+ configurable : true
+});
+
+o.b; // 38
+// 对象 o 拥有了属性 b,值为 38
+// 现在,除非重新定义 o.b,o.b 的值总是与 bValue 相同
+
+// 数据描述符和存取描述符不能混合使用
+Object.defineProperty(o, "conflict", {
+ value: 0x9f91102,
+ get() { return 0xdeadbeef; }
+});
+// 抛出错误 TypeError: value appears only in data descriptors, get appears only in accessor descriptors
+</pre>
+
+<h3 id="修改属性">修改属性</h3>
+
+<p>如果属性已经存在,<code>Object.defineProperty()</code>将尝试根据描述符中的值以及对象当前的配置来修改这个属性。如果旧描述符将其<code>configurable</code> 属性设置为<code>false</code>,则该属性被认为是“不可配置的”,并且没有属性可以被改变(除了单向改变 writable 为 false)。当属性不可配置时,不能在数据和访问器属性类型之间切换。</p>
+
+<p>当试图改变不可配置属性(除了 <code>value</code> 和 <code>writable</code> 属性之外)的值时,会抛出{{jsxref("TypeError")}},除非当前值和新值相同。</p>
+
+<h4 id="Writable_属性">Writable 属性</h4>
+
+<p>当 <code>writable</code> 属性设置为 <code>false</code> 时,该属性被称为“不可写的”。它不能被重新赋值。</p>
+
+<pre class="brush: js notranslate">var o = {}; // 创建一个新对象
+
+Object.defineProperty(o, 'a', {
+ value: 37,
+ writable: false
+});
+
+console.log(o.a); // logs 37
+o.a = 25; // No error thrown
+// (it would throw in strict mode,
+// even if the value had been the same)
+console.log(o.a); // logs 37. The assignment didn't work.
+
+// strict mode
+(function() {
+ 'use strict';
+ var o = {};
+ Object.defineProperty(o, 'b', {
+ value: 2,
+ writable: false
+ });
+ o.b = 3; // throws TypeError: "b" is read-only
+ return o.b; // returns 2 without the line above
+}());</pre>
+
+<p>如示例所示,试图写入非可写属性不会改变它,也不会引发错误。</p>
+
+<h4 id="Enumerable_属性">Enumerable 属性</h4>
+
+<p><code>enumerable</code> 定义了对象的属性是否可以在 {{jsxref("Statements/for...in", "for...in")}} 循环和 {{jsxref("Object.keys()")}} 中被枚举。</p>
+
+<pre class="brush: js notranslate">var o = {};
+Object.defineProperty(o, "a", { value : 1, enumerable: true });
+Object.defineProperty(o, "b", { value : 2, enumerable: false });
+Object.defineProperty(o, "c", { value : 3 }); // enumerable 默认为 false
+o.d = 4; // 如果使用直接赋值的方式创建对象的属性,则 enumerable 为 true
+Object.defineProperty(o, Symbol.for('e'), {
+  value: 5,
+  enumerable: true
+});
+Object.defineProperty(o, Symbol.for('f'), {
+  value: 6,
+  enumerable: false
+});
+
+for (var i in o) {
+ console.log(i);
+}
+// logs 'a' and 'd' (in undefined order)
+
+Object.keys(o); // ['a', 'd']
+
+o.propertyIsEnumerable('a'); // true
+o.propertyIsEnumerable('b'); // false
+o.propertyIsEnumerable('c'); // false
+o.propertyIsEnumerable('d'); // true
+o.propertyIsEnumerable(Symbol.for('e')); // true
+o.propertyIsEnumerable(Symbol.for('f')); // false
+
+var p = { ...o }
+p.a // 1
+p.b // undefined
+p.c // undefined
+p.d // 4
+p[Symbol.for('e')] // 5
+p[Symbol.for('f')] // undefined</pre>
+
+<h4 id="Configurable_属性">Configurable 属性</h4>
+
+<p><code>configurable</code> 特性表示对象的属性是否可以被删除,以及除 <code>value</code> 和 <code>writable</code> 特性外的其他特性是否可以被修改。</p>
+
+<pre class="brush: js notranslate">var o = {};
+Object.defineProperty(o, 'a', {
+ get() { return 1; },
+ configurable: false
+});
+
+Object.defineProperty(o, 'a', {
+ configurable: true
+}); // throws a TypeError
+Object.defineProperty(o, 'a', {
+ enumerable: true
+}); // throws a TypeError
+Object.defineProperty(o, 'a', {
+ set() {}
+}); // throws a TypeError (set was undefined previously)
+Object.defineProperty(o, 'a', {
+ get() { return 1; }
+}); // throws a TypeError
+// (even though the new get does exactly the same thing)
+Object.defineProperty(o, 'a', {
+ value: 12
+}); // throws a TypeError // ('value' can be changed when 'configurable' is false but not in this case due to 'get' accessor)
+
+console.log(o.a); // logs 1
+delete o.a; // Nothing happens
+console.log(o.a); // logs 1</pre>
+
+<p>如果 <code>o.a</code> 的 <code>configurable</code> 属性为 <code>true</code>,则不会抛出任何错误,并且,最后,该属性会被删除。</p>
+
+<h3 id="添加多个属性和默认值">添加多个属性和默认值</h3>
+
+<p>考虑特性被赋予的默认特性值非常重要,通常,使用点运算符和 <code>Object.defineProperty()</code> 为对象的属性赋值时,数据描述符中的属性默认值是不同的,如下例所示。</p>
+
+<pre class="brush: js notranslate">var o = {};
+
+o.a = 1;
+// 等同于:
+Object.defineProperty(o, "a", {
+ value: 1,
+ writable: true,
+ configurable: true,
+ enumerable: true
+});
+
+
+// 另一方面,
+Object.defineProperty(o, "a", { value : 1 });
+// 等同于:
+Object.defineProperty(o, "a", {
+ value: 1,
+ writable: false,
+ configurable: false,
+ enumerable: false
+});
+</pre>
+
+<h3 id="自定义_Setters_和_Getters">自定义 Setters 和 Getters</h3>
+
+<p>下面的例子展示了如何实现一个自存档对象。当设置<code>temperature</code> 属性时,<code>archive</code> 数组会收到日志条目。</p>
+
+<pre class="brush: js notranslate">function Archiver() {
+ var temperature = null;
+ var archive = [];
+
+ Object.defineProperty(this, 'temperature', {
+ get: function() {
+ console.log('get!');
+ return temperature;
+ },
+ set: function(value) {
+ temperature = value;
+ archive.push({ val: temperature });
+ }
+ });
+
+ this.getArchive = function() { return archive; };
+}
+
+var arc = new Archiver();
+arc.temperature; // 'get!'
+arc.temperature = 11;
+arc.temperature = 13;
+arc.getArchive(); // [{ val: 11 }, { val: 13 }]</pre>
+
+<p>下面这个例子中,getter 总是会返回一个相同的值。</p>
+
+<pre class="brush: js notranslate">var pattern = {
+ get: function () {
+ return 'I alway return this string,whatever you have assigned';
+ },
+ set: function () {
+ this.myname = 'this is my name string';
+ }
+};
+
+
+function TestDefineSetAndGet() {
+ Object.defineProperty(this, 'myproperty', pattern);
+}
+
+
+var instance = new TestDefineSetAndGet();
+instance.myproperty = 'test';
+
+// 'I alway return this string,whatever you have assigned'
+console.log(instance.myproperty);
+// 'this is my name string'
+console.log(instance.myname);</pre>
+
+<h3 id="继承属性">继承属性</h3>
+
+<p>如果访问者的属性是被继承的,它的 <code>get</code> 和 <code>set</code> 方法会在子对象的属性被访问或者修改时被调用。如果这些方法用一个变量存值,该值会被所有对象共享。</p>
+
+<pre class="brush: js notranslate">function myclass() {
+}
+
+var value;
+Object.defineProperty(myclass.prototype, "x", {
+ get() {
+ return value;
+ },
+ set(x) {
+ value = x;
+ }
+});
+
+var a = new myclass();
+var b = new myclass();
+a.x = 1;
+console.log(b.x); // 1
+</pre>
+
+<p>这可以通过将值存储在另一个属性中解决。在 <code>get</code> 和 <code>set</code> 方法中,<code>this</code> 指向某个被访问和修改属性的对象。</p>
+
+<pre class="brush: js notranslate">function myclass() {
+}
+
+Object.defineProperty(myclass.prototype, "x", {
+ get() {
+ return this.stored_x;
+ },
+ set(x) {
+ this.stored_x = x;
+ }
+});
+
+var a = new myclass();
+var b = new myclass();
+a.x = 1;
+console.log(b.x); // undefined</pre>
+
+<p>不像访问者属性,值属性始终在对象自身上设置,而不是一个原型。然而,如果一个不可写的属性被继承,它仍然可以防止修改对象的属性。</p>
+
+<pre class="brush: js notranslate">function myclass() {
+}
+
+myclass.prototype.x = 1;
+Object.defineProperty(myclass.prototype, "y", {
+ writable: false,
+ value: 1
+});
+
+var a = new myclass();
+a.x = 2;
+console.log(a.x); // 2
+console.log(myclass.prototype.x); // 1
+a.y = 2; // Ignored, throws in strict mode
+console.log(a.y); // 1
+console.log(myclass.prototype.y); // 1
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.6', 'Object.defineProperty')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.5.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.defineproperty', 'Object.defineProperty')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.defineproperty', 'Object.defineProperty')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("javascript.builtins.Object.defineProperty")}}</p>
+
+<h2 id="兼容性问题">兼容性问题</h2>
+
+<h3 id="重定义数组_Array_对象的_length_属性">重定义数组 <code>Array</code> 对象的 <code>length</code> 属性</h3>
+
+<p>重定义数组的 {{jsxref("Array.length", "length")}} 属性是可能的,但是会受到一般的重定义限制。({{jsxref("Array.length", "length")}} 属性初始为 non-configurable,non-enumerable 以及 writable。对于一个内容不变的数组,改变其 {{jsxref("Array.length", "length")}} 属性的值或者使它变为 non-writable 是可能的。但是改变其可枚举性和可配置性或者当它是 non-writable 时尝试改变它的值或是可写性,这两者都是不允许的。)然而,并不是所有的浏览器都允许 <code>Array.length</code> 的重定义。</p>
+
+<p>在 Firefox 4 至 22 版本中,尝试重定义数组的 length 属性都会抛出 {{jsxref("TypeError")}} 异常。</p>
+
+<p>一些版本的 Chrome 中,<code>Object.defineProperty()</code> 在某些情况下会忽略不同于数组当前{{jsxref("Array.length", "length")}}属性的length值。有些情况下改变可写性并不起作用(也不抛出异常)。同时,比如{{jsxref("Array.prototype.push")}}的一些数组操作方法也不会考虑不可读的length属性。</p>
+
+<p>一些版本的 Safari 中,<code>Object.defineProperty()</code> 在某些情况下会忽略不同于数组当前{{jsxref("Array.length", "length")}}属性的length值。尝试改变可写性的操作会正常执行而不抛出错误,但事实上并未改变属性的可写性。</p>
+
+<p>只在Internet Explorer 9及以后版本和Firefox 23及以后版本中,才完整地正确地支持数组 {{jsxref("Array.length", "length")}} 属性的重新定义。目前不要依赖于重定义数组 {{jsxref("Array.length", "length")}} 属性能够起作用,或在特定情形下起作用。与此同时,即使你能够依赖于它,你也<a href="http://whereswalden.com/2013/08/05/new-in-firefox-23-the-length-property-of-an-array-can-be-made-non-writable-but-you-shouldnt-do-it/">没有合适的理由这样做</a>。</p>
+
+<h3 id="Internet_Explorer_8_特别备注">Internet Explorer 8 特别备注</h3>
+
+<p>Internet Explorer 8 实现了 <code>Object.defineProperty()</code> 方法,但<a class="external" href="http://msdn.microsoft.com/en-us/library/dd229916%28VS.85%29.aspx">只能在 DOM 对象上使用</a>。 需要注意的一些事情:</p>
+
+<ul>
+ <li>尝试在原生对象上使用 <code>Object.defineProperty()</code> 会报错。</li>
+ <li>属性特性必须设置一些特定的值。对于数据属性描述符,<code>configurable</code>, <code>enumerable</code> 和 <code>writable</code> 属性必须全部设置为 <code>true</code>;对于访问器属性描述符,<code>configurable</code> 必须设置为 <code>true</code>,<code>enumerable</code> 必须设置为 <code>false</code>。(?) 任何试图提供其他值(?)将导致一个错误抛出。</li>
+ <li>重新配置一个属性首先需要删除该属性。如果属性没有删除,就如同重新配置前的尝试。</li>
+</ul>
+
+<h3 id="Chrome_37(及以下)特别备注">Chrome 37(及以下)特别备注</h3>
+
+<p>Chrome 37(及以下)有一个 <a href="https://bugs.chromium.org/p/v8/issues/detail?id=3448">bug</a>,使用 <code>writable: false</code> 定义原型 prototype 属性,或者函数时,不会像预期的那样工作。</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Enumerability_and_ownership_of_properties">属性的可枚举性和所有权</a></li>
+ <li>{{jsxref("Object.defineProperties()")}}</li>
+ <li>{{jsxref("Object.propertyIsEnumerable()")}}</li>
+ <li>{{jsxref("Object.getOwnPropertyDescriptor()")}}</li>
+ <li>{{jsxref("Object.prototype.watch()")}}</li>
+ <li>{{jsxref("Object.prototype.unwatch()")}}</li>
+ <li>{{jsxref("Operators/get", "get")}}</li>
+ <li>{{jsxref("Operators/set", "set")}}</li>
+ <li>{{jsxref("Object.create()")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty/Additional_examples">Additional <code>Object.defineProperty</code> examples</a></li>
+ <li>{{jsxref("Reflect.defineProperty()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/entries/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/entries/index.html
new file mode 100644
index 0000000000..6e704940a5
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/entries/index.html
@@ -0,0 +1,134 @@
+---
+title: Object.entries()
+slug: Web/JavaScript/Reference/Global_Objects/Object/entries
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/entries
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.entries()</strong></code>方法返回一个给定对象自身可枚举属性的键值对数组,其排列与使用 {{jsxref("Statements/for...in", "for...in")}} 循环遍历该对象时返回的顺序一致(区别在于 for-in 循环还会枚举原型链中的属性)。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-entries.html", "taller")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">Object.entries(<var>obj</var>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>可以返回其可枚举属性的键值对的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<dl>
+ <dd>给定对象自身可枚举属性的键值对数组。</dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p><code>Object.entries()</code>返回一个数组,其元素是与直接在<code>object</code>上找到的可枚举属性键值对相对应的数组。属性的顺序与通过手动循环对象的属性值所给出的顺序相同。</p>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">const obj = { foo: 'bar', baz: 42 };
+console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ]
+
+// array like object
+const obj = { 0: 'a', 1: 'b', 2: 'c' };
+console.log(Object.entries(obj)); // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]
+
+// array like object with random key ordering
+const anObj = { 100: 'a', 2: 'b', 7: 'c' };
+console.log(Object.entries(anObj)); // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ]
+
+// getFoo is property which isn't enumerable
+const myObj = Object.create({}, { getFoo: { value() { return this.foo; } } });
+myObj.foo = 'bar';
+console.log(Object.entries(myObj)); // [ ['foo', 'bar'] ]
+
+// non-object argument will be coerced to an object
+console.log(Object.entries('foo')); // [ ['0', 'f'], ['1', 'o'], ['2', 'o'] ]
+
+// iterate through key-value gracefully
+const obj = { a: 5, b: 7, c: 9 };
+for (const [key, value] of Object.entries(obj)) {
+ console.log(`${key} ${value}`); // "a 5", "b 7", "c 9"
+}
+
+// Or, using array extras
+Object.entries(obj).forEach(([key, value]) =&gt; {
+console.log(`${key} ${value}`); // "a 5", "b 7", "c 9"
+});</pre>
+
+<h3 id="将Object转换为Map">将<code>Object</code>转换为<code>Map</code></h3>
+
+<p>{{jsxref("Map", "new Map()")}} 构造函数接受一个可迭代的<code>entries</code>。借助<code>Object.entries</code>方法你可以很容易的将{{jsxref("Object")}}转换为{{jsxref("Map")}}:</p>
+
+<pre class="brush: js">var obj = { foo: "bar", baz: 42 };
+var map = new Map(Object.entries(obj));
+console.log(map); // Map { foo: "bar", baz: 42 }</pre>
+
+<h2 id="Polyfill">Polyfill</h2>
+
+<p>要在较旧环境中添加兼容的<code>Object.entries</code>支持,你可以在 <a href="https://github.com/tc39/proposal-object-values-entries">tc39/proposal-object-values-entries</a> 中找到Object.entries的示例(如果你不需要任何对IE的支持),在 <a href="https://github.com/es-shims/Object.entries">es-shims/Object.entries</a> 资料库中的一个polyfill,或者你可以使用下面列出的简易 polyfill。</p>
+
+<pre class="brush: js">if (!Object.entries)
+ Object.entries = function( obj ){
+ var ownProps = Object.keys( obj ),
+ i = ownProps.length,
+ resArray = new Array(i); // preallocate the Array
+ while (i--)
+ resArray[i] = [ownProps[i], obj[ownProps[i]]];
+
+ return resArray;
+ };</pre>
+
+<p>对于上述 polyfill 代码片段,如果你需要 IE9 以下的支持,那么你还需要一个 Object.keys polyfill(如 {{jsxref("Object.keys")}}页面上的)。</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.entries', 'Object.entries')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES8', '#sec-object.entries', 'Object.entries')}}</td>
+ <td>{{Spec2('ES8')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.entries")}}</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Enumerability_and_ownership_of_properties">属性的可枚举性和所有权</a></li>
+ <li>{{jsxref("Object.keys()")}}</li>
+ <li>{{jsxref("Object.values()")}} {{experimental_inline}}</li>
+ <li>{{jsxref("Object.prototype.propertyIsEnumerable()")}}</li>
+ <li>{{jsxref("Object.create()")}}</li>
+ <li>{{jsxref("Object.getOwnPropertyNames()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html
new file mode 100644
index 0000000000..e823c314a8
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html
@@ -0,0 +1,85 @@
+---
+title: Object.prototype.eval()
+slug: Web/JavaScript/Reference/Global_Objects/Object/eval
+translation_of: Archive/Web/JavaScript/Object.eval
+---
+<div>{{JSRef}} {{obsolete_header}}</div>
+
+<p><code><strong>Object.eval()</strong></code> 方法用于在对象的上下文中对 JavaScript 代码字符串求值,但该方法已被移除。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.eval(<var>string</var>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>string</code></dt>
+ <dd>包含任意 JavaScript 表达式、语句或一组语句的字符串。表达式中可包含已有对象的变量与属性。</dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p><code>eval</code> 方法已从对象方法中移除。可使用全局 {{jsxref("Global_Objects/eval", "eval()")}} 函数替代该方法。</p>
+
+<h2 id="规范">规范</h2>
+
+<p>暂无规范</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Global_Objects/eval", "eval()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html
new file mode 100644
index 0000000000..b72dbbf9c0
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html
@@ -0,0 +1,206 @@
+---
+title: Object.freeze()
+slug: Web/JavaScript/Reference/Global_Objects/Object/freeze
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/freeze
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Object.freeze()</code></strong> 方法可以<strong>冻结</strong>一个对象。一个被冻结的对象再也不能被修改;冻结了一个对象则不能向这个对象添加新的属性,不能删除已有属性,不能修改该对象已有属性的可枚举性、可配置性、可写性,以及不能修改已有属性的值。此外,冻结一个对象后该对象的原型也不能被修改。<code>freeze()</code> 返回和传入的参数相同的对象。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-freeze.html")}}</div>
+
+
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.freeze(<em>obj</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>要被冻结的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>被冻结的对象。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>被冻结对象自身的所有属性都不可能以任何方式被修改。任何修改尝试都会失败,无论是静默地还是通过抛出{{jsxref("TypeError")}}异常(最常见但不仅限于{{jsxref("Strict_mode", "strict mode", "", 1)}})。</p>
+
+<p>数据属性的值不可更改,访问器属性(有getter和setter)也同样(但由于是函数调用,给人的错觉是还是可以修改这个属性)。如果一个属性的值是个对象,则这个对象中的属性是可以修改的,除非它也是个冻结对象。数组作为一种对象,被冻结,其元素不能被修改。没有数组元素可以被添加或移除。</p>
+
+<p>这个方法返回传递的对象,而不是创建一个被冻结的副本。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<h3 id="冻结对象">冻结对象</h3>
+
+<pre class="brush: js">var obj = {
+ prop: function() {},
+ foo: 'bar'
+};
+
+// 新的属性会被添加, 已存在的属性可能
+// 会被修改或移除
+obj.foo = 'baz';
+obj.lumpy = 'woof';
+delete obj.prop;
+
+// 作为参数传递的对象与返回的对象都被冻结
+// 所以不必保存返回的对象(因为两个对象全等)
+var o = Object.freeze(obj);
+
+o === obj; // true
+Object.isFrozen(obj); // === true
+
+// 现在任何改变都会失效
+obj.foo = 'quux'; // 静默地不做任何事
+// 静默地不添加此属性
+obj.quaxxor = 'the friendly duck';
+
+// 在严格模式,如此行为将抛出 TypeErrors
+function fail(){
+ 'use strict';
+ obj.foo = 'sparky'; // throws a TypeError
+ delete obj.quaxxor; // 返回true,因为quaxxor属性从来未被添加
+ obj.sparky = 'arf'; // throws a TypeError
+}
+
+fail();
+
+// 试图通过 Object.defineProperty 更改属性
+// 下面两个语句都会抛出 TypeError.
+Object.defineProperty(obj, 'ohai', { value: 17 });
+Object.defineProperty(obj, 'foo', { value: 'eit' });
+
+// 也不能更改原型
+// 下面两个语句都会抛出 TypeError.
+Object.setPrototypeOf(obj, { x: 20 })
+obj.__proto__ = { x: 20 }</pre>
+
+<h3 class="brush: js" id="冻结数组">冻结数组</h3>
+
+<pre class="brush: js">let a = [0];
+Object.freeze(a); // 现在数组不能被修改了.
+
+a[0]=1; // fails silently
+a.push(2); // fails silently
+
+// In strict mode such attempts will throw TypeErrors
+function fail() {
+ "use strict"
+ a[0] = 1;
+ a.push(2);
+}
+
+fail();</pre>
+
+<p>被冻结的对象是不可变的。但也不总是这样。下例展示了冻结对象不是常量对象(浅冻结)。</p>
+
+<pre class="brush: js">obj1 = {
+ internal: {}
+};
+
+Object.freeze(obj1);
+obj1.internal.a = 'aValue';
+
+obj1.internal.a // 'aValue'
+</pre>
+
+<p>对于一个常量对象,整个引用图(直接和间接引用其他对象)只能引用不可变的冻结对象。冻结的对象被认为是不可变的,因为整个对象中的整个对象状态(对其他对象的值和引用)是固定的。注意,字符串,数字和布尔总是不可变的,而函数和数组是对象。</p>
+
+<p>要使对象不可变,需要递归冻结每个类型为对象的属性(深冻结)。当你知道对象在引用图中不包含任何 <em><a href="https://en.wikipedia.org/wiki/Cycle_(graph_theory)">环</a> </em>(循环引用)时,将根据你的设计逐个使用该模式,否则将触发无限循环。对 deepFreeze()  的增强将是具有接收路径(例如Array)参数的内部函数,以便当对象进入不变时,可以递归地调用 deepFreeze() 。你仍然有冻结不应冻结的对象的风险,例如[window]。</p>
+
+<pre class="brush: js">// 深冻结函数.
+function deepFreeze(obj) {
+
+ // 取回定义在obj上的属性名
+ var propNames = Object.getOwnPropertyNames(obj);
+
+ // 在冻结自身之前冻结属性
+ propNames.forEach(function(name) {
+ var prop = obj[name];
+
+ // 如果prop是个对象,冻结它
+ if (typeof prop == 'object' &amp;&amp; prop !== null)
+ deepFreeze(prop);
+ });
+
+ // 冻结自身(no-op if already frozen)
+ return Object.freeze(obj);
+}
+
+obj2 = {
+ internal: {}
+};
+
+deepFreeze(obj2);
+obj2.internal.a = 'anotherValue';
+obj2.internal.a; // undefined
+</pre>
+
+<h2 id="Notes">Notes</h2>
+
+<p>在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 {{jsxref("TypeError")}}。在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回。</p>
+
+<pre class="brush: js">&gt; Object.freeze(1)
+TypeError: 1 is not an object // ES5 code
+
+&gt; Object.freeze(1)
+1 // ES2015 code</pre>
+
+<h3 id="对比_Object.seal()">对比 <code>Object.seal()</code></h3>
+
+<p>用<code>Object.seal()</code>密封的对象可以改变它们现有的属性。使用<code>Object.freeze()</code> 冻结的对象中现有属性是不可变的。</p>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.9', 'Object.freeze')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.<br>
+ Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.freeze', 'Object.freeze')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.freeze', 'Object.freeze')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.freeze")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.isFrozen")}}</li>
+ <li>{{jsxref("Object.preventExtensions")}}</li>
+ <li>{{jsxref("Object.isExtensible")}}</li>
+ <li>{{jsxref("Object.seal")}}</li>
+ <li>{{jsxref("Object.isSealed")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/fromentries/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/fromentries/index.html
new file mode 100644
index 0000000000..80cb1de95a
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/fromentries/index.html
@@ -0,0 +1,105 @@
+---
+title: Object.fromEntries()
+slug: Web/JavaScript/Reference/Global_Objects/Object/fromEntries
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/fromEntries
+---
+<div>{{JSRef}}</div>
+
+<p> <code><strong>Object.fromEntries()</strong></code> 方法把键值对列表转换为一个对象。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-fromentries.html")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate">Object.fromEntries(<var>iterable</var>);</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>iterable</code></dt>
+ <dd>类似 {{jsxref("Array")}} 、 {{jsxref("Map")}} 或者其它实现了<a href="/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol">可迭代协议</a>的可迭代对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>一个由该迭代对象条目提供对应属性的新对象。</p>
+
+<h2 id="描述">描述</h2>
+
+<p><code>Object.fromEntries()</code> 方法接收一个键值对的列表参数,并返回一个带有这些键值对的新对象。这个迭代参数应该是一个能够实现<code>@@iterator</code>方法的的对象,返回一个迭代器对象。它生成一个具有两个元素的类数组的对象,第一个元素是将用作属性键的值,第二个元素是与该属性键关联的值。</p>
+
+<p><code>Object.fromEntries()</code> 执行与 {{jsxref("Object.entries")}} 互逆的操作。</p>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="Map_转化为_Object"> <code>Map</code> 转化为 <code>Object</code></h3>
+
+<p>通过 <code>Object.fromEntries</code>, 可以将 {{jsxref("Map")}} 转换为 {{jsxref("Object")}}:</p>
+
+<pre class="brush: js notranslate">const map = new Map([ ['foo', 'bar'], ['baz', 42] ]);
+const obj = Object.fromEntries(map);
+console.log(obj); // { foo: "bar", baz: 42 }
+</pre>
+
+<h3 id="Array_转化为_Object"><code>Array</code> 转化为 <code>Object</code></h3>
+
+<p>通过 <code>Object.fromEntries</code>, 可以将 {{jsxref("Array")}} 转换为 {{jsxref("Object")}}:</p>
+
+<pre class="brush: js notranslate">const arr = [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ];
+const obj = Object.fromEntries(arr);
+console.log(obj); // { 0: "a", 1: "b", 2: "c" }
+</pre>
+
+<h3 id="对象转换">对象转换</h3>
+
+<p><code>Object.fromEntries</code> 是与 {{jsxref("Object.entries()")}} 相反的方法,用 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Methods_2">数组处理函数</a> 可以像下面这样转换对象:</p>
+
+<pre class="brush: js notranslate">const object1 = { a: 1, b: 2, c: 3 };
+
+const object2 = Object.fromEntries(
+ Object.entries(object1)
+ .map(([ key, val ]) =&gt; [ key, val * 2 ])
+);
+
+console.log(object2);
+// { a: 2, b: 4, c: 6 }</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.fromentries', 'Object.fromEntries')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td>在 ECMAScript 2019 中首次被定义。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.builtins.Object.fromEntries")}}</p>
+</div>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.entries()")}}</li>
+ <li>{{jsxref("Object.keys()")}}</li>
+ <li>{{jsxref("Object.values()")}}</li>
+ <li>{{jsxref("Map.prototype.entries()")}}</li>
+ <li>{{jsxref("Map.prototype.keys()")}}</li>
+ <li>{{jsxref("Map.prototype.values()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html
new file mode 100644
index 0000000000..fac0573de3
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/getnotifier/index.html
@@ -0,0 +1,93 @@
+---
+title: Object.getNotifier()
+slug: Web/JavaScript/Reference/Global_Objects/Object/getNotifier
+translation_of: Archive/Web/JavaScript/Object.getNotifier
+---
+<div>{{JSRef}} {{obsolete_header}}</div>
+
+<p><strong><code>Object.getNotifer()</code></strong> 方法用于创建可人工触发 change 事件的对象,但该方法在浏览器中已被废弃。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">Object.getNotifier(<em>obj</em>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>获取通知的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>与传入对象相关联的通知对象。</p>
+
+<h2 id="描述">描述</h2>
+
+<p><code><font face="Open Sans, Arial, sans-serif">通知对象可触发 </font>Object.observe() 所观察到的人工变动。</code></p>
+
+<h2 id="规范">规范</h2>
+
+<p><a href="https://github.com/arv/ecmascript-object-observe">Strawman proposal specification.</a></p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome("36")}} [1]</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("23")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatChrome("36")}} [1]</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("23")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] Deprecated in Chrome 49.</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.observe()")}} {{obsolete_inline}}</li>
+ <li>{{jsxref("Object.unobserve()")}} {{obsolete_inline}}</li>
+ <li>{{jsxref("Array.observe()")}} {{obsolete_inline}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html
new file mode 100644
index 0000000000..a5b4088128
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html
@@ -0,0 +1,147 @@
+---
+title: Object.getOwnPropertyDescriptor()
+slug: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor
+tags:
+ - JavaScript
+ - Object
+ - 对象
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Object.getOwnPropertyDescriptor()</code></strong> 方法返回指定对象上一个自有属性对应的属性描述符。(自有属性指的是直接赋予该对象的属性,不需要从原型链上进行查找的属性)</p>
+
+<p>{{EmbedInteractiveExample("pages/js/object-getownpropertydescriptor.html")}}</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox notranslate">Object.getOwnPropertyDescriptor(<em>obj</em>, <em>prop</em>)</pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>需要查找的目标对象</dd>
+ <dt><code>prop</code></dt>
+ <dd>目标对象内属性名称</dd>
+</dl>
+
+<h3 id="返回值" style="line-height: 24px;">返回值</h3>
+
+<p>如果指定的属性存在于对象上,则返回其属性描述符对象(property descriptor),否则返回 {{jsxref("undefined")}}。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>该方法允许对一个属性的描述进行检索。在 Javascript 中, <dfn>属性</dfn> 由一个字符串类型的“名字”(name)和一个“属性描述符”(property descriptor)对象构成。更多关于属性描述符类型以及他们属性的信息可以查看:{{jsxref("Object.defineProperty")}}.</p>
+
+<p>一个属性描述符是一个记录,由下面属性当中的某些组成的:</p>
+
+<dl>
+ <dt><code><strong>value</strong></code></dt>
+ <dd>该属性的值(仅针对数据属性描述符有效)</dd>
+ <dt><code><strong>writable</strong></code></dt>
+ <dd><code>当且仅当属性的值可以被改变时为true。(仅针对数据属性描述有效)</code></dd>
+ <dt><code><strong>get</strong></code></dt>
+ <dd>获取该属性的访问器函数(getter)。如果没有访问器, 该值为undefined。(仅针对包含访问器或设置器的属性描述有效)</dd>
+ <dt><code><strong>set</strong></code></dt>
+ <dd>获取该属性的设置器函数(setter)。 如果没有设置器, 该值为undefined。(仅针对包含访问器或设置器的属性描述有效)</dd>
+ <dt><code><strong>configurable</strong></code></dt>
+ <dd><code>当且仅当指定对象的属性描述可以被改变或者属性可被删除时,为true。</code></dd>
+ <dt><code><strong>enumerable</strong></code></dt>
+ <dd>当且仅当指定对象的属性可以被枚举出时,为 <code>true</code>。</dd>
+</dl>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<pre class="brush: js notranslate">var o, d;
+
+o = { get foo() { return 17; } };
+d = Object.getOwnPropertyDescriptor(o, "foo");
+// d {
+// configurable: true,
+// enumerable: true,
+// get: /*the getter function*/,
+// set: undefined
+// }
+
+o = { bar: 42 };
+d = Object.getOwnPropertyDescriptor(o, "bar");
+// d {
+// configurable: true,
+// enumerable: true,
+// value: 42,
+// writable: true
+// }
+
+o = {};
+Object.defineProperty(o, "baz", {
+ value: 8675309,
+ writable: false,
+ enumerable: false
+});
+d = Object.getOwnPropertyDescriptor(o, "baz");
+// d {
+// value: 8675309,
+// writable: false,
+// enumerable: false,
+// configurable: false
+// }</pre>
+
+<h2 id="注意事项">注意事项</h2>
+
+<p>在 ES5 中,如果该方法的第一个参数不是对象(而是原始类型),那么就会产生出现 {{jsxref("TypeError")}}。而在 ES2015,第一个的参数不是对象的话就会被强制转换为对象。</p>
+
+<pre class="brush: js notranslate">Object.getOwnPropertyDescriptor('foo', 0);
+// 类型错误: "foo" 不是一个对象 // ES5 code
+
+Object.getOwnPropertyDescriptor('foo', 0);
+// Object returned by ES2015 code: {
+// configurable: false,
+// enumerable: true,
+// value: "f",
+// writable: false
+// }</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">批注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.3', 'Object.getOwnPropertyDescriptor')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.<br>
+ Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.getownpropertydescriptor', 'Object.getOwnPropertyDescriptor')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.getownpropertydescriptor', 'Object.getOwnPropertyDescriptor')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{Compat("javascript.builtins.Object.getOwnPropertyDescriptor")}}</div>
+
+<div></div>
+
+<div id="compat-mobile"></div>
+
+<div id="compat-desktop"><strong style="">相关链接</strong> </div>
+
+<ul>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li>{{jsxref("Reflect.getOwnPropertyDescriptor()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptors/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptors/index.html
new file mode 100644
index 0000000000..f07f3bfa33
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptors/index.html
@@ -0,0 +1,87 @@
+---
+title: Object.getOwnPropertyDescriptors()
+slug: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.getOwnPropertyDescriptors()</strong></code> 方法用来获取一个对象的所有自身属性的描述符。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">Object.getOwnPropertyDescriptors(<var>obj</var>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>任意对象</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>所指定对象的所有自身属性的描述符,如果没有任何自身属性,则返回空对象。</p>
+
+<dl>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="浅拷贝一个对象">浅拷贝一个对象</h3>
+
+<p>{{jsxref("Object.assign()")}} 方法只能拷贝源对象的可枚举的自身属性,同时拷贝时无法拷贝属性的特性们,而且访问器属性会被转换成数据属性,也无法拷贝源对象的原型,该方法配合 {{jsxref("Object.create()")}} 方法可以实现上面说的这些。</p>
+
+<pre class="brush: js">Object.create(
+ Object.getPrototypeOf(obj),
+ Object.getOwnPropertyDescriptors(obj)
+);
+</pre>
+
+<h3 id="创建子类">创建子类</h3>
+
+<p>创建子类的典型方法是定义子类,将其原型设置为超类的实例,然后在该实例上定义属性。这么写很不优雅,特别是对于 getters 和 setter 而言。 相反,您可以使用此代码设置原型:</p>
+
+<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">superclass</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span><span class="punctuation token">}</span>
+superclass<span class="punctuation token">.</span>prototype <span class="operator token">=</span> <span class="punctuation token">{</span>
+ <span class="comment token">// 在这里定义方法和属性</span>
+<span class="punctuation token">}</span><span class="punctuation token">;</span>
+<span class="keyword token">function</span> <span class="function token">subclass</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span><span class="punctuation token">}</span>
+subclass<span class="punctuation token">.</span>prototype <span class="operator token">=</span> Object<span class="punctuation token">.</span><span class="function token">create</span><span class="punctuation token">(</span>superclass<span class="punctuation token">.</span>prototype<span class="punctuation token">,</span> Object<span class="punctuation token">.</span><span class="function token">getOwnPropertyDescriptors</span><span class="punctuation token">(</span><span class="punctuation token">{</span>
+ <span class="comment token">// 在这里定义方法和属性</span>
+<span class="punctuation token">}</span><span class="punctuation token">)</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.getownpropertydescriptors', 'Object.getOwnPropertyDescriptors')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td>Initial definition in ECMAScript 2017.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2017', '#sec-object.getownpropertydescriptors', 'Object.getOwnPropertyDescriptors')}}</td>
+ <td>{{Spec2('ES2017')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{Compat("javascript.builtins.Object.getOwnPropertyDescriptors")}}</div>
+
+<div id="compat-desktop"> </div>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.getOwnPropertyDescriptor()")}}</li>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li><a href="https://github.com/tc39/proposal-object-getownpropertydescriptors">Polyfill</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html
new file mode 100644
index 0000000000..996a67689e
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html
@@ -0,0 +1,169 @@
+---
+title: Object.getOwnPropertyNames()
+slug: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - JavaScript 1.8.5
+ - Method
+ - Object
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Object.getOwnPropertyNames()</code></strong>方法返回一个由指定对象的所有自身属性的属性名(包括不可枚举属性但不包括Symbol值作为名称的属性)组成的数组。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox">Object.getOwnPropertyNames(<em>obj</em>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>一个对象,其自身的可枚举和不可枚举属性的名称被返回。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>在给定对象上找到的自身属性对应的字符串数组。</p>
+
+<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2>
+
+<p><code>Object.getOwnPropertyNames()</code> 返回一个数组,该数组对元素是 <code>obj</code>自身拥有的枚举或不可枚举属性名称字符串。 数组中枚举属性的顺序与通过 {{jsxref("Statements/for...in", "for...in")}} 循环(或 {{jsxref("Object.keys")}})迭代该对象属性时一致。数组中不可枚举属性的顺序未定义。</p>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="使用_Object.getOwnPropertyNames()">使用 <code>Object.getOwnPropertyNames()</code></h3>
+
+<pre class="brush: js">var arr = ["a", "b", "c"];
+console.log(Object.getOwnPropertyNames(arr).sort()); // ["0", "1", "2", "length"]
+
+// 类数组对象
+var obj = { 0: "a", 1: "b", 2: "c"};
+console.log(Object.getOwnPropertyNames(obj).sort()); // ["0", "1", "2"]
+
+// 使用Array.forEach输出属性名和属性值
+Object.getOwnPropertyNames(obj).forEach(function(val, idx, array) {
+ console.log(val + " -&gt; " + obj[val]);
+});
+// 输出
+// 0 -&gt; a
+// 1 -&gt; b
+// 2 -&gt; c
+
+//不可枚举属性
+var my_obj = Object.create({}, {
+ getFoo: {
+ value: function() { return this.foo; },
+ enumerable: false
+ }
+});
+my_obj.foo = 1;
+
+console.log(Object.getOwnPropertyNames(my_obj).sort()); // ["foo", "getFoo"]
+</pre>
+
+<p>如果你只要获取到可枚举属性,查看{{jsxref("Object.keys")}}或用{{jsxref("Statements/for...in", "for...in")}}循环(还会获取到原型链上的可枚举属性,不过可以使用{{jsxref("Object.prototype.hasOwnProperty()", "hasOwnProperty()")}}方法过滤掉)。</p>
+
+<p>下面的例子演示了该方法不会获取到原型链上的属性:</p>
+
+<pre class="brush: js">function ParentClass() {}
+ParentClass.prototype.inheritedMethod = function() {};
+
+function ChildClass() {
+  this.prop = 5;
+  this.method = function() {};
+}
+
+ChildClass.prototype = new ParentClass;
+ChildClass.prototype.prototypeMethod = function() {};
+
+console.log(
+  Object.getOwnPropertyNames(
+  new ChildClass() // ["prop", "method"]
+  )
+);
+</pre>
+
+<h3 id="只获取不可枚举的属性">只获取不可枚举的属性</h3>
+
+<p>下面的例子使用了 {{jsxref("Array.prototype.filter()")}} 方法,从所有的属性名数组(使用<code>Object.getOwnPropertyNames()</code>方法获得)中去除可枚举的属性(使用{{jsxref("Object.keys()")}}方法获得),剩余的属性便是不可枚举的属性了:</p>
+
+<pre class="brush: js">var target = myObject;
+var enum_and_nonenum = Object.getOwnPropertyNames(target);
+var enum_only = Object.keys(target);
+var nonenum_only = enum_and_nonenum.filter(function(key) {
+    var indexInEnum = enum_only.indexOf(key);
+    if (indexInEnum == -1) {
+        // 没有发现在enum_only健集中意味着这个健是不可枚举的,
+        // 因此返回true 以便让它保持在过滤结果中
+        return true;
+    } else {
+        return false;
+    }
+});
+
+console.log(nonenum_only);</pre>
+
+<pre>注:<a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter">Array.filter(filt_func)方法</a>创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。</pre>
+
+<h2 id="Notes" name="Notes">提示</h2>
+
+<p>在 ES5 中,如果参数不是一个原始对象类型,将抛出一个 {{jsxref("TypeError")}}  异常。在 ES2015 中,非对象参数被强制转换为对象 <strong>。</strong></p>
+
+<pre class="brush: js">Object.getOwnPropertyNames('foo');
+// TypeError: "foo" is not an object (ES5 code)
+
+Object.getOwnPropertyNames('foo');
+// ['length', '0', '1', '2'] (ES2015 code)
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.4', 'Object.getOwnPropertyNames')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.5.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.getownpropertynames', 'Object.getOwnPropertyNames')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.getownpropertynames', 'Object.getOwnPropertyNames')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.getOwnPropertyNames")}}</p>
+
+<h2 id="Firefox-specific_notes">Firefox-specific notes</h2>
+
+<p>Firefox 28 {{geckoRelease("28")}}之前,<code>Object.getOwnPropertyNames</code> 不会获取到 {{jsxref("Error")}} 对象的属性。该 bug 在后面的版本修复了 ({{bug("724768")}})。</p>
+
+<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2>
+
+<ul>
+ <li><a href="https://developer.mozilla.org/en-US/docs/Enumerability_and_ownership_of_properties" title="Enumerability_and_ownership_of_properties">Enumerability and ownership of properties</a></li>
+ <li>{{jsxref("Object.prototype.hasOwnProperty")}}</li>
+ <li>{{jsxref("Object.prototype.propertyIsEnumerable")}}</li>
+ <li>{{jsxref("Object.create")}}</li>
+ <li>{{jsxref("Object.keys")}}</li>
+ <li>{{jsxref("Array.forEach()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertysymbols/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertysymbols/index.html
new file mode 100644
index 0000000000..3ef6f41842
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertysymbols/index.html
@@ -0,0 +1,85 @@
+---
+title: Object.getOwnPropertySymbols()
+slug: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols
+tags:
+ - ECMAScript 2015
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.getOwnPropertySymbols()</strong></code> 方法返回一个给定对象自身的所有 Symbol 属性的数组。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.getOwnPropertySymbols(<em>obj</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>要返回 Symbol 属性的对象。</dd>
+ <dt>
+ <h3 id="返回值">返回值</h3>
+ </dt>
+ <dd>在给定对象自身上找到的所有 Symbol 属性的数组。</dd>
+</dl>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>与{{jsxref("Object.getOwnPropertyNames()")}}类似,您可以将给定对象的所有符号属性作为 Symbol 数组获取。 请注意,{{jsxref("Object.getOwnPropertyNames()")}}本身不包含对象的 Symbol 属性,只包含字符串属性。</p>
+
+<p>因为所有的对象在初始化的时候不会包含任何的 Symbol,除非你在对象上赋值了 Symbol 否则<code>Object.getOwnPropertySymbols()</code>只会返回一个空的数组。</p>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">var obj = {};
+var a = Symbol("a");
+var b = Symbol.for("b");
+
+obj[a] = "localSymbol";
+obj[b] = "globalSymbol";
+
+var objectSymbols = Object.getOwnPropertySymbols(obj);
+
+console.log(objectSymbols.length); // 2
+console.log(objectSymbols) // [Symbol(a), Symbol(b)]
+console.log(objectSymbols[0]) // Symbol(a)
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-object.getownpropertysymbols', 'Object.getOwnPropertySymbols')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.getownpropertysymbols', 'Object.getOwnPropertySymbols')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.getOwnPropertySymbols")}}</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.getOwnPropertyNames()")}}</li>
+ <li>{{jsxref("Symbol")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html
new file mode 100644
index 0000000000..e81cee9d3f
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html
@@ -0,0 +1,137 @@
+---
+title: Object.getPrototypeOf()
+slug: Web/JavaScript/Reference/Global_Objects/Object/GetPrototypeOf
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.getPrototypeOf()</strong></code> 方法返回指定对象的原型(内部<code>[[Prototype]]</code>属性的值)。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code>Object.getPrototypeOf(<em>object</em>)</code>
+</pre>
+
+<dl>
+ <dt>
+ <h3 id="参数">参数</h3>
+ </dt>
+ <dt><code>obj</code></dt>
+ <dd>要返回其原型的对象。</dd>
+ <dt>
+ <h3 id="返回值">返回值</h3>
+ </dt>
+ <dd>给定对象的原型。如果没有继承属性,则返回 {{jsxref("null")}} 。</dd>
+</dl>
+
+<p>{{EmbedInteractiveExample("pages/js/object-getprototypeof.html")}}</p>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<pre class="brush: js">var proto = {};
+var obj = Object.create(proto);
+Object.getPrototypeOf(obj) === proto; // true
+
+var reg = /a/;
+Object.getPrototypeOf(reg) === RegExp.prototype; // true</pre>
+
+<h3 id="说明">说明</h3>
+
+<div class="note">
+<p><strong>Object.getPrototypeOf(Object)  不是  Object.prototype</strong></p>
+</div>
+
+<pre class="brush: js">JavaScript中的 <strong><a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></strong> 是构造函数(创建对象的包装器)。
+一般用法是:
+var obj = new Object();
+
+所以:
+Object.getPrototypeOf( Object ); // ƒ () { [native code] }
+Object.getPrototypeOf( Function ); // ƒ () { [native code] }
+
+Object.getPrototypeOf( Object ) === Function.prototype; // true
+
+Object.getPrototypeOf( Object )是把Object这一构造函数看作对象,
+返回的当然是函数对象的原型,也就是 Function.prototype。
+
+正确的方法是,Object.prototype是<strong>构造出来的对象的原型</strong>。
+var obj = new Object();
+Object.prototype === Object.getPrototypeOf( obj ); // true
+
+Object.prototype === Object.getPrototypeOf( {} ); // true</pre>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 19px; background: 0px 0px;"> </div>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 38px; background: 0px 0px;"> </div>
+
+<h2 id="Notes" name="Notes">Notes</h2>
+
+<p>在 ES5 中,如果参数不是一个对象类型,将抛出一个{{jsxref("TypeError")}}异常。在 ES2015 中,参数会被强制转换为一个 {{jsxref("Object")}}<strong style="font-weight: bold;">。</strong></p>
+
+<pre class="brush: js">Object.getPrototypeOf('foo');
+// TypeError: "foo" is not an object (ES5 code)
+Object.getPrototypeOf('foo');
+// String.prototype (ES2015 code)</pre>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 19px; background: 0px 0px;"> </div>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 38px; background: 0px 0px;"> </div>
+
+<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 57px; background: 0px 0px;"> </div>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.2', 'Object.getPrototypeOf')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.getprototypeof', 'Object.getPrototypeOf')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.getprototypeof', 'Object.getPrototypeOf')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.getPrototypeOf")}}</p>
+
+<h2 id="Opera_特别提示">Opera 特别提示</h2>
+
+<p>即使旧版本Opera不支持<code>Object.getPrototypeOf()</code>,Opera 10.50之后还支持非标准的 {{jsxref("Object.proto", "__proto__")}}属性。</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.isPrototypeOf")}}</li>
+ <li>{{jsxref("Object.setPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.prototype.__proto__")}}</li>
+ <li>John Resig's post on <a class="external external-icon" href="http://ejohn.org/blog/objectgetprototypeof/" style="white-space: pre-line;" title="http://ejohn.org/blog/objectgetprototypeof/">getPrototypeOf</a></li>
+ <li>{{jsxref("Reflect.getPrototypeOf()")}}</li>
+ <li>{{jsxref("AsyncFunction")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/hasownproperty/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/hasownproperty/index.html
new file mode 100644
index 0000000000..70f5f307d6
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/hasownproperty/index.html
@@ -0,0 +1,168 @@
+---
+title: Object.prototype.hasOwnProperty()
+slug: Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Prototype
+ - 原型
+ - 对象
+ - 属性
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>hasOwnProperty()</strong></code> 方法会返回一个布尔值,指示对象自身属性中是否具有指定的属性(也就是,是否有指定的键)。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-prototype-hasownproperty.html")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate"><var>obj</var>.hasOwnProperty(<var>prop</var>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><var>prop</var></dt>
+ <dd>要检测的属性的 {{jsxref("String")}} 字符串形式表示的名称,或者 {{jsxref("Symbol")}}。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>用来判断某个对象是否含有指定的属性的布尔值 {{jsxref("Boolean")}}。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>所有继承了 {{jsxref("Object")}} 的对象都会继承到 <code>hasOwnProperty</code> 方法。这个方法可以用来检测一个对象是否含有特定的自身属性;和 {{jsxref("Operators/in", "in")}} 运算符不同,该方法会忽略掉那些从原型链上继承到的属性。</p>
+
+<h2 id="备注">备注</h2>
+
+<p>即使属性的值是 <code>null</code> 或 <code>undefined</code>,只要属性存在,<code>hasOwnProperty</code> 依旧会返回 <code>true</code>。</p>
+
+<pre class="brush: js notranslate">o = new Object();
+o.propOne = null;
+o.hasOwnProperty('propOne'); // 返回 true
+o.propTwo = undefined;
+o.hasOwnProperty('propTwo'); // 返回 true
+</pre>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="使用_hasOwnProperty_方法判断属性是否存在">使用 <code>hasOwnProperty</code> 方法判断属性是否存在</h3>
+
+<p>下面的例子检测了对象 <code>o</code> 是否含有自身属性 <code>prop</code>:</p>
+
+<pre class="brush: js notranslate">o = new Object();
+o.hasOwnProperty('prop'); // 返回 false
+o.prop = 'exists';
+o.hasOwnProperty('prop'); // 返回 true
+delete o.prop;
+o.hasOwnProperty('prop'); // 返回 false
+</pre>
+
+<h3 id="自身属性与继承属性">自身属性与继承属性</h3>
+
+<p>下面的例子演示了 <code>hasOwnProperty</code> 方法对待自身属性和继承属性的区别:</p>
+
+<pre class="brush: js notranslate">o = new Object();
+o.prop = 'exists';
+o.hasOwnProperty('prop'); // 返回 true
+o.hasOwnProperty('toString'); // 返回 false
+o.hasOwnProperty('hasOwnProperty'); // 返回 false
+</pre>
+
+<h3 id="遍历一个对象的所有自身属性">遍历一个对象的所有自身属性</h3>
+
+<p>下面的例子演示了如何在遍历一个对象的所有属性时忽略掉继承属性,注意这里 {{jsxref("Statements/for...in", "for...in")}}  循环只会遍历可枚举属性,所以不应该基于这个循环中没有不可枚举的属性而得出 <code>hasOwnProperty</code> 是严格限制于可枚举项目的(如同 {{jsxref("Object.getOwnPropertyNames()")}})。</p>
+
+<pre class="brush: js notranslate">var buz = {
+ fog: 'stack'
+};
+
+for (var name in buz) {
+ if (buz.hasOwnProperty(name)) {
+ console.log('this is fog (' +
+ name + ') for sure. Value: ' + buz[name]);
+ }
+ else {
+ console.log(name); // toString or something else
+ }
+}
+</pre>
+
+<h3 id="使用_hasOwnProperty_作为属性名">使用 <code>hasOwnProperty</code> 作为属性名</h3>
+
+<p>JavaScript 并没有保护 <code>hasOwnProperty</code> 这个属性名,因此,当某个对象可能自有一个占用该属性名的属性时,就需要使用外部的 <code>hasOwnProperty</code> 获得正确的结果:</p>
+
+<pre class="brush: js notranslate">var foo = {
+ hasOwnProperty: function() {
+ return false;
+ },
+ bar: 'Here be dragons'
+};
+
+foo.hasOwnProperty('bar'); // 始终返回 false
+
+// 如果担心这种情况,
+// 可以直接使用原型链上真正的 hasOwnProperty 方法
+({}).hasOwnProperty.call(foo, 'bar'); // true
+
+// 也可以使用 Object 原型上的 hasOwnProperty 属性
+Object.prototype.hasOwnProperty.call(foo, 'bar'); // true
+</pre>
+
+<p>注意,只有在最后一种情况下,才不会新建任何对象。</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.hasownproperty', 'Object.prototype.hasOwnProperty')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.hasownproperty', 'Object.prototype.hasOwnProperty')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.5', 'Object.prototype.hasOwnProperty')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES3')}}</td>
+ <td>{{Spec2('ES3')}}</td>
+ <td>最开始在JavaScript 1.5实现。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("javascript.builtins.Object.hasOwnProperty")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Enumerability_and_ownership_of_properties">属性的可枚举性和所有权</a></li>
+ <li>{{jsxref("Object.getOwnPropertyNames()")}}</li>
+ <li>{{jsxref("Statements/for...in", "for...in")}}</li>
+ <li>{{jsxref("Operators/in", "in")}}</li>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Inheritance_and_the_prototype_chain">继承与原型链</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/index.html
new file mode 100644
index 0000000000..1cfeb4d57c
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/index.html
@@ -0,0 +1,183 @@
+---
+title: Object
+slug: Web/JavaScript/Reference/Global_Objects/Object
+tags:
+ - Constructor
+ - JavaScript
+ - Object
+ - 对象
+ - 构造器
+translation_of: Web/JavaScript/Reference/Global_Objects/Object
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object</strong></code> 构造函数创建一个对象包装器。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="notranslate">// 对象初始化器(Object initialiser)或对象字面量(literal)
+{ [ <var>nameValuePair1</var>[, <var>nameValuePair2</var>[, ...<var>nameValuePairN</var>] ] ] }
+
+// 以构造函数形式来调用
+new Object([<var>value</var>])</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>nameValuePair1, nameValuePair2, ... nameValuePair<em>N</em></code></dt>
+ <dd>成对的名称(字符串)与值(任何值),其中名称通过冒号与值分隔。</dd>
+ <dt><code>value</code></dt>
+ <dd>任何值。</dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p>在JavaScript中,几乎所有的对象都是<code>Object</code>类型的实例,它们都会从<code>Object.prototype</code>继承属性和方法。<code>Object</code> 构造函数为给定值创建一个对象包装器。<code>Object</code>构造函数,会根据给定的参数创建对象,具体有以下情况:</p>
+
+<ul>
+ <li>如果给定值是 {{jsxref("null")}} 或 {{jsxref("undefined")}},将会创建并返回一个空对象</li>
+ <li>如果传进去的是一个基本类型的值,则会构造其包装类型的对象</li>
+ <li>如果传进去的是引用类型的值,仍然会返回这个值,经他们复制的变量保有和源对象相同的引用地址</li>
+</ul>
+
+<p>当以非构造函数形式被调用时,<code>Object</code> 的行为等同于 <code>new Object()</code>。</p>
+
+<p>可查看 <a href="/zh-CN/docs/Web/JavaScript/Reference/Operators/Object_initializer">对象初始化/字面量语法</a>。</p>
+
+<h2 id="Properties" name="Properties"><code>Object</code> 构造函数的属性</h2>
+
+<dl>
+ <dt><code>Object.length</code></dt>
+ <dd>值为 1。</dd>
+</dl>
+
+<dl>
+ <dt>{{jsxref("Object.prototype")}}</dt>
+ <dd>可以为所有 Object 类型的对象添加属性。</dd>
+</dl>
+
+<h2 id="Object_构造函数的方法"><code>Object</code> 构造函数的方法</h2>
+
+<dl>
+ <dt>{{jsxref("Object.assign()")}}</dt>
+ <dd>通过复制一个或多个对象来创建一个新的对象。</dd>
+ <dt>{{jsxref("Object.create()")}}</dt>
+ <dd>使用指定的原型对象和属性创建一个新对象。</dd>
+ <dt>{{jsxref("Object.defineProperty()")}}</dt>
+ <dd>给对象添加一个属性并指定该属性的配置。</dd>
+ <dt>{{jsxref("Object.defineProperties()")}}</dt>
+ <dd>给对象添加多个属性并分别指定它们的配置。</dd>
+ <dt>{{jsxref("Object.entries()")}}</dt>
+ <dd>返回给定对象自身可枚举属性的 <code>[key, value]</code> 数组。</dd>
+ <dt>{{jsxref("Object.freeze()")}}</dt>
+ <dd>冻结对象:其他代码不能删除或更改任何属性。</dd>
+ <dt>{{jsxref("Object.getOwnPropertyDescriptor()")}}</dt>
+ <dd>返回对象指定的属性配置。</dd>
+ <dt>{{jsxref("Object.getOwnPropertyNames()")}}</dt>
+ <dd>返回一个数组,它包含了指定对象所有的可枚举或不可枚举的属性名。</dd>
+ <dt>{{jsxref("Object.getOwnPropertySymbols()")}}</dt>
+ <dd>返回一个数组,它包含了指定对象自身所有的符号属性。</dd>
+ <dt>{{jsxref("Object.getPrototypeOf()")}}</dt>
+ <dd>返回指定对象的原型对象。</dd>
+ <dt>{{jsxref("Object.is()")}}</dt>
+ <dd>比较两个值是否相同。所有 NaN 值都相等(这与==和===不同)。</dd>
+ <dt>{{jsxref("Object.isExtensible()")}}</dt>
+ <dd>判断对象是否可扩展。</dd>
+ <dt>{{jsxref("Object.isFrozen()")}}</dt>
+ <dd>判断对象是否已经冻结。</dd>
+ <dt>{{jsxref("Object.isSealed()")}}</dt>
+ <dd>判断对象是否已经密封。</dd>
+ <dt>{{jsxref("Object.keys()")}}</dt>
+ <dd>返回一个包含所有给定对象<strong>自身</strong>可枚举属性名称的数组。</dd>
+ <dt>{{jsxref("Object.preventExtensions()")}}</dt>
+ <dd>防止对象的任何扩展。</dd>
+ <dt>{{jsxref("Object.seal()")}}</dt>
+ <dd>防止其他代码删除对象的属性。</dd>
+ <dt>{{jsxref("Object.setPrototypeOf()")}}</dt>
+ <dd>设置对象的原型(即内部 <code>[[Prototype]]</code> 属性)。</dd>
+ <dt>{{jsxref("Object.values()")}}</dt>
+ <dd>返回给定对象自身可枚举值的数组。</dd>
+</dl>
+
+<h2 id="Object_实例和_Object_原型对象"><code>Object</code> 实例和 <code>Object</code> 原型对象</h2>
+
+<p>JavaScript中的所有对象都来自 <code>Object</code>;所有对象从{{jsxref("Object.prototype")}}继承方法和属性,尽管它们可能被覆盖。例如,其他构造函数的原型将覆盖 <code>constructor</code> 属性并提供自己的 <code>toString()</code> 方法。<code>Object</code> 原型对象的更改将传播到所有对象,除非受到这些更改的属性和方法将沿原型链进一步覆盖。</p>
+
+<h3 id="属性">属性</h3>
+
+<div>{{ page('zh-CN/docs/JavaScript/Reference/Global_Objects/Object/prototype', 'Properties') }}</div>
+
+<h3 id="Methods_of_Object_instances" name="Methods_of_Object_instances">方法</h3>
+
+<div>{{ page('zh-CN/docs/JavaScript/Reference/Global_Objects/Object/prototype', 'Methods') }}</div>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<h3 id="Example.3A_Using_Object_given_undefined_and_null_types" name="Example.3A_Using_Object_given_undefined_and_null_types">给定 <code>undefined</code> 和 <code>null</code> 类型使用 <code>Object</code></h3>
+
+<p>下面的例子将一个空的 <code>Object</code> 对象存到 <code>o</code> 中:</p>
+
+<pre class="brush: js notranslate">var o = new Object();
+</pre>
+
+<pre class="brush: js notranslate">var o = new Object(undefined);
+</pre>
+
+<pre class="brush: js notranslate">var o = new Object(null);
+</pre>
+
+<h3 id="使用_Object_生成布尔对象">使用 <code>Object</code> 生成布尔对象</h3>
+
+<p>下面的例子将{{jsxref("Boolean")}} 对象存到 <code>o</code> 中:</p>
+
+<pre class="brush: js notranslate">// 等价于 o = new Boolean(true);
+var o = new Object(true);
+</pre>
+
+<pre class="brush: js notranslate">// 等价于 o = new Boolean(false);
+var o = new Object(Boolean());
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.0.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2', 'Object')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object-objects', 'Object')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Added Object.assign, Object.getOwnPropertySymbols, Object.setPrototypeOf, Object.is</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object-objects', 'Object')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td>Added Object.entries and Object.values.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Reference/Operators/Object_initializer">初始化对象</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/is/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/is/index.html
new file mode 100644
index 0000000000..ed905858d9
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/is/index.html
@@ -0,0 +1,150 @@
+---
+title: Object.is()
+slug: Web/JavaScript/Reference/Global_Objects/Object/is
+tags:
+ - ECMAScript 2015
+ - JavaScript
+ - 判断
+ - 对象
+ - 方法
+ - 相等
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/is
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.is()</strong></code> 方法判断两个值是否为<a href="/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness">同一个值</a>。</p>
+
+<p><font face="x-locale-heading-primary, zillaslab, Palatino, Palatino Linotype, x-locale-heading-secondary, serif"><span style="font-size: 37.33327865600586px;"><strong>语法</strong></span></font></p>
+
+<p>
+ </p><pre class="syntaxbox notranslate"><code>Object.is(<var>value1</var>, <var>value2</var>);</code></pre>
+
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code><var>value1</var></code></dt>
+ <dd>被比较的第一个值。</dd>
+ <dt><code><var>value2</var></code></dt>
+ <dd>被比较的第二个值。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>一个 {{jsxref("Boolean")}} 类型标示两个参数是否是同一个值。</p>
+
+<h2 id="描述">描述</h2>
+
+<p><code>Object.is()</code> 方法判断两个值是否为<a href="/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness">同一个值</a>。如果满足以下条件则两个值相等:</p>
+
+<ul>
+ <li>都是 {{jsxref("undefined")}}</li>
+ <li>都是 {{jsxref("null")}}</li>
+ <li>都是 <code>true</code> 或 <code>false</code></li>
+ <li>都是相同长度的字符串且相同字符按相同顺序排列</li>
+ <li>都是相同对象(意味着每个对象有同一个引用)</li>
+ <li>都是数字且
+ <ul>
+ <li>都是 <code>+0</code></li>
+ <li>都是 <code>-0</code></li>
+ <li>都是 {{jsxref("NaN")}}</li>
+ <li>或都是非零而且非 {{jsxref("NaN")}} 且为同一个值</li>
+ </ul>
+ </li>
+</ul>
+
+<p>与{{jsxref("Operators/Comparison_Operators", "==", "#Equality")}} 运算<em>不同。</em>  <code>==</code> 运算符在判断相等前对两边的变量(如果它们不是同一类型) 进行强制转换 (这种行为的结果会将 <code>"" == false</code> 判断为 <code>true</code>), 而 <code>Object.is</code>不会强制转换两边的值。</p>
+
+<p>与{{jsxref("Operators/Comparison_Operators", "===", "#Identity")}} 运算也不相同。 <code>===</code> 运算符 (也包括 <code>==</code> 运算符) 将数字 <code>-0</code> 和 <code>+0</code> 视为相等 ,而将{{jsxref("Number.NaN")}} 与{{jsxref("NaN")}}视为不相等.</p>
+
+<h2 id="Polyfill">Polyfill</h2>
+
+<pre class="brush: js notranslate">if (!Object.is) {
+ Object.is = function(x, y) {
+ // SameValue algorithm
+ if (x === y) { // Steps 1-5, 7-10
+ // Steps 6.b-6.e: +0 != -0
+ return x !== 0 || 1 / x === 1 / y;
+ } else {
+ // Step 6.a: NaN == NaN
+ return x !== x &amp;&amp; y !== y;
+ }
+ };
+}
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-object.is', 'Object.is')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.is', 'Object.is')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="例子">例子</h2>
+
+<h3 id="使用_Object.is">使用 Object.is</h3>
+
+<pre class="brush: js notranslate">Object.is('foo', 'foo'); // true
+Object.is(window, window); // true
+
+Object.is('foo', 'bar'); // false
+Object.is([], []); // false
+
+var foo = { a: 1 };
+var bar = { a: 1 };
+Object.is(foo, foo); // true
+Object.is(foo, bar); // false
+
+Object.is(null, null); // true
+
+// 特例
+Object.is(0, -0); // false
+Object.is(0, +0); // true
+Object.is(-0, -0); // true
+Object.is(NaN, 0/0); // true
+</pre>
+
+<p><font face="x-locale-heading-primary, zillaslab, Palatino, Palatino Linotype, x-locale-heading-secondary, serif"><span style="font-size: 37.33327865600586px;"><strong>规范</strong></span></font></p>
+
+<p>
+ </p><table>
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.is', 'Object.is')}}<br>
+  </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.is")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness">JavaScript 中的相等性判断</a> — JavaScript 中的三种相等性判断方法的比较</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html
new file mode 100644
index 0000000000..c168d98bfd
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html
@@ -0,0 +1,144 @@
+---
+title: Object.isExtensible()
+slug: Web/JavaScript/Reference/Global_Objects/Object/isExtensible
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/isExtensible
+---
+<div>{{JSRef("Global_Objects", "Object")}}</div>
+
+<h2 id="Summary" name="Summary">概述</h2>
+
+<p><code><strong>Object.isExtensible()</strong></code> 方法判断一个对象是否是可扩展的(是否可以在它上面添加新的属性)。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.isExtensible(<em>obj</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt>obj</dt>
+ <dd>需要检测的对象</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>    表示给定对象是否可扩展的一个<a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Boolean" title="此页面仍未被本地化, 期待您的翻译!"><code>Boolean</code></a> 。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>默认情况下,对象是可扩展的:即可以为他们添加新的属性。以及它们的 {{jsxref("Object.proto", "__proto__")}}{{deprecated_inline}} 属性可以被更改。{{jsxref("Object.preventExtensions")}},{{jsxref("Object.seal")}} 或 {{jsxref("Object.freeze")}} 方法都可以标记一个对象为不可扩展(non-extensible)。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<pre class="brush: js">// 新对象默认是可扩展的.
+var empty = {};
+Object.isExtensible(empty); // === true
+
+// ...可以变的不可扩展.
+Object.preventExtensions(empty);
+Object.isExtensible(empty); // === false
+
+// 密封对象是不可扩展的.
+var sealed = Object.seal({});
+Object.isExtensible(sealed); // === false
+
+// 冻结对象也是不可扩展.
+var frozen = Object.freeze({});
+Object.isExtensible(frozen); // === false
+</pre>
+
+<p> </p>
+
+<h2 id="注意" style="margin-bottom: 20px; line-height: 30px;">注意</h2>
+
+<p>在 ES5 中,如果参数不是一个对象类型,将抛出一个 {{jsxref("TypeError")}} 异常。在 ES6 中, non-object 参数将被视为一个不可扩展的普通对象,因此会返回 false 。</p>
+
+<pre>Object.isExtensible(1);
+// TypeError: 1 is not an object (ES5 code)
+
+Object.isExtensible(1);
+// false (ES6 code)
+</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.13', 'Object.isExtensible')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.<br>
+ Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.isextensible', 'Object.isExtensible')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Firefox (Gecko)</th>
+ <th>Chrome</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>4 (2.0)</td>
+ <td>6</td>
+ <td>9</td>
+ <td>12</td>
+ <td>5.1</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Android</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2>
+
+<ul>
+ <li><strong>{{jsxref("Object.preventExtensions")}}</strong></li>
+ <li>{{jsxref("Object.seal")}}</li>
+ <li>{{jsxref("Object.isSealed")}}</li>
+ <li>{{jsxref("Object.freeze")}}</li>
+ <li>{{jsxref("Object.isFrozen")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html
new file mode 100644
index 0000000000..5ab6d88862
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html
@@ -0,0 +1,153 @@
+---
+title: Object.isFrozen()
+slug: Web/JavaScript/Reference/Global_Objects/Object/isFrozen
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - JavaScript 1.8.5
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/isFrozen
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.isFrozen()</strong></code>方法判断一个对象是否被{{jsxref("Object.freeze()", "冻结", "", 1)}}。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.isFrozen(<var>obj</var>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>被检测的对象。</dd>
+ <dt>
+ <h3 id="返回值">返回值</h3>
+ </dt>
+ <dd>表示给定对象是否被冻结的{{jsxref("Boolean")}}。</dd>
+</dl>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>一个对象是冻结的是指它不可{{jsxref("Object.isExtensible", "扩展")}},所有属性都是不可配置的,且所有数据属性(即没有getter或setter组件的访问器的属性)都是不可写的。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<pre class="brush: js">// 一个对象默认是可扩展的,所以它也是非冻结的.
+Object.isFrozen({}); // === false
+
+// 一个不可扩展的空对象同时也是一个冻结对象.
+var vacuouslyFrozen = Object.preventExtensions({});
+Object.isFrozen(vacuouslyFrozen) //=== true;
+
+// 一个非空对象默认也是非冻结的.
+var oneProp = { p: 42 };
+Object.isFrozen(oneProp) //=== false
+
+// 让这个对象变的不可扩展,并不意味着这个对象变成了冻结对象,
+// 因为p属性仍然是可以配置的(而且可写的).
+Object.preventExtensions(oneProp);
+Object.isFrozen(oneProp) //=== false
+
+// 此时,如果删除了这个属性,则它会成为一个冻结对象.
+delete oneProp.p;
+Object.isFrozen(oneProp) //=== true
+
+// 一个不可扩展的对象,拥有一个不可写但可配置的属性,则它仍然是非冻结的.
+var nonWritable = { e: "plep" };
+Object.preventExtensions(nonWritable);
+Object.defineProperty(nonWritable, "e", { writable: false }); // 变得不可写
+Object.isFrozen(nonWritable) //=== false
+
+// 把这个属性改为不可配置,会让这个对象成为冻结对象.
+Object.defineProperty(nonWritable, "e", { configurable: false }); // 变得不可配置
+Object.isFrozen(nonWritable) //=== true
+
+// 一个不可扩展的对象,拥有一个不可配置但可写的属性,则它仍然是非冻结的.
+var nonConfigurable = { release: "the kraken!" };
+Object.preventExtensions(nonConfigurable);
+Object.defineProperty(nonConfigurable, "release", { configurable: false });
+Object.isFrozen(nonConfigurable) //=== false
+
+// 把这个属性改为不可写,会让这个对象成为冻结对象.
+Object.defineProperty(nonConfigurable, "release", { writable: false });
+Object.isFrozen(nonConfigurable) //=== true
+
+// 一个不可扩展的对象,值拥有一个访问器属性,则它仍然是非冻结的.
+var accessor = { get food() { return "yum"; } };
+Object.preventExtensions(accessor);
+Object.isFrozen(accessor) //=== false
+
+// ...但把这个属性改为不可配置,会让这个对象成为冻结对象.
+Object.defineProperty(accessor, "food", { configurable: false });
+Object.isFrozen(accessor) //=== true
+
+// 使用Object.freeze是冻结一个对象最方便的方法.
+var frozen = { 1: 81 };
+Object.isFrozen(frozen) //=== false
+Object.freeze(frozen);
+Object.isFrozen(frozen) //=== true
+
+// 一个冻结对象也是一个密封对象.
+Object.isSealed(frozen) //=== true
+
+// 当然,更是一个不可扩展的对象.
+Object.isExtensible(frozen) //=== false
+
+</pre>
+
+<h2 id="注意">注意</h2>
+
+<p>在 ES5 中,如果参数不是一个对象类型,将抛出一个{{jsxref("TypeError")}}异常。在 ES2015 中,非对象参数将被视为一个冻结的普通对象,因此会返回<code>true</code>。</p>
+
+<pre class="brush: js">Object.isFrozen(1);
+// TypeError: 1 is not an object (ES5 code)
+
+Object.isFrozen(1);
+// true (ES2015 code)
+</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.12', 'Object.isFrozen')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.<br>
+ Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.isfrozen', 'Object.isFrozen')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.isfrozen', 'Object.isFrozen')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.isFrozen")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.freeze()")}}</li>
+ <li>{{jsxref("Object.preventExtensions()")}}</li>
+ <li>{{jsxref("Object.isExtensible()")}}</li>
+ <li>{{jsxref("Object.seal()")}}</li>
+ <li>{{jsxref("Object.isSealed()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/isprototypeof/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/isprototypeof/index.html
new file mode 100644
index 0000000000..84ce38e934
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/isprototypeof/index.html
@@ -0,0 +1,171 @@
+---
+title: Object.prototype.isPrototypeOf()
+slug: Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf
+tags:
+ - JavaScript
+ - Object
+ - Prototype
+ - isPrototypeOf()
+ - 原型
+ - 对象
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>isPrototypeOf()</strong></code> 方法用于测试一个对象是否存在于另一个对象的原型链上。</p>
+
+<div class="note">
+<p><code>isPrototypeOf()</code> 与 {{jsxref("Operators/instanceof", "instanceof")}} 运算符不同。在表达式 "<code>object instanceof AFunction</code>"中,<code>object</code> 的原型链是针对 <code>AFunction.prototype</code> 进行检查的,而不是针对 <code>AFunction</code> 本身。</p>
+</div>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>prototypeObj</var>.isPrototypeOf(<var>object</var>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>object</code></dt>
+ <dd>在该对象的原型链上搜寻</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>{{jsxref("Boolean")}},表示调用对象是否在另一个对象的原型链上。</p>
+
+<h3 id="报错">报错</h3>
+
+<dl>
+ <dt>{{jsxref("TypeError")}}</dt>
+ <dd>如果 <code><var>prototypeObj</var></code> 为 undefined 或 null,会抛出 {{jsxref("TypeError")}}。</dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p><code>isPrototypeOf()</code> 方法允许你检查一个对象是否存在于另一个对象的原型链上。</p>
+
+<h2 id="示例">示例</h2>
+
+<p>本示例展示了 <code>Baz.prototype</code>, <code>Bar.prototype</code>, <code>Foo.prototype</code> 和 <code>Object.prototype</code> 在 <code>baz</code> 对象的原型链上:</p>
+
+<pre class="brush: js">function Foo() {}
+function Bar() {}
+function Baz() {}
+
+Bar.prototype = Object.create(Foo.prototype);
+Baz.prototype = Object.create(Bar.prototype);
+
+var baz = new Baz();
+
+console.log(Baz.prototype.isPrototypeOf(baz)); // true
+console.log(Bar.prototype.isPrototypeOf(baz)); // true
+console.log(Foo.prototype.isPrototypeOf(baz)); // true
+console.log(Object.prototype.isPrototypeOf(baz)); // true
+</pre>
+
+<p>如果你有段代码只在需要操作继承自一个特定的原型链的对象的情况下执行,同 {{jsxref("Operators/instanceof", "instanceof")}} 操作符一样 <code>isPrototypeOf()</code> 方法就会派上用场,例如,为了确保某些方法或属性将位于对象上。</p>
+
+<p>例如,检查 <code>baz</code> 对象是否继承自 <code>Foo.prototype</code>:</p>
+
+<pre class="brush: js">if (Foo.prototype.isPrototypeOf(baz)) {
+  // do something safe
+}
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范版本</th>
+ <th scope="col">规范状态</th>
+ <th scope="col">注解</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES3')}}</td>
+ <td>{{Spec2('ES3')}}</td>
+ <td>初始定义</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.5', 'Object.prototype.hasOwnProperty')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.hasownproperty', 'Object.prototype.hasOwnProperty')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.hasownproperty', 'Object.prototype.hasOwnProperty')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>特性</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>基础支持</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>特性</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>基础支持</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Operators/instanceof", "instanceof")}}</li>
+ <li>{{jsxref("Object.getPrototypeOf()")}}</li>
+ <li>
+ <div>{{jsxref("Object.setPrototypeOf()")}}</div>
+ </li>
+ <li>{{jsxref("Object.prototype.__proto__")}} </li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html
new file mode 100644
index 0000000000..df91848da8
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html
@@ -0,0 +1,124 @@
+---
+title: Object.isSealed()
+slug: Web/JavaScript/Reference/Global_Objects/Object/isSealed
+tags:
+ - ECMAScript5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/isSealed
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Object.isSealed()</code></strong> 方法判断一个对象是否被密封。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate"><code>Object.isSealed(<em>obj</em>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>要被检查的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>表示给定对象是否被密封的一个{{jsxref("Boolean")}} 。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>如果这个对象是密封的,则返回 <code>true</code>,否则返回 <code>false</code>。密封对象是指那些不可 {{jsxref("Object.isExtensible", "扩展")}} 的,且所有自身属性都不可配置且因此不可删除(但不一定是不可写)的对象。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<pre class="brush: js notranslate">// 新建的对象默认不是密封的.
+var empty = {};
+Object.isSealed(empty); // === false
+
+// 如果你把一个空对象变的不可扩展,则它同时也会变成个密封对象.
+Object.preventExtensions(empty);
+Object.isSealed(empty); // === true
+
+// 但如果这个对象不是空对象,则它不会变成密封对象,因为密封对象的所有自身属性必须是不可配置的.
+var hasProp = { fee: "fie foe fum" };
+Object.preventExtensions(hasProp);
+Object.isSealed(hasProp); // === false
+
+// 如果把这个属性变的不可配置,则这个属性也就成了密封对象.
+Object.defineProperty(hasProp, "fee", { configurable: false });
+Object.isSealed(hasProp); // === false
+Object.isSealed(hasProp.fee); // === true
+
+// 最简单的方法来生成一个密封对象,当然是使用Object.seal.
+var sealed = {};
+Object.seal(sealed);
+Object.isSealed(sealed); // === true
+
+// 一个密封对象同时也是不可扩展的.
+Object.isExtensible(sealed); // === false
+
+// 一个密封对象也可以是一个冻结对象,但不是必须的.
+Object.isFrozen(sealed); // === true ,所有的属性都是不可写的
+var s2 = Object.seal({ p: 3 });
+Object.isFrozen(s2); // === false, 属性"p"可写
+
+var s3 = Object.seal({ get p() { return 0; } });
+Object.isFrozen(s3); // === true ,访问器属性不考虑可写不可写,只考虑是否可配置</pre>
+
+<h2 id="注意" style="margin-bottom: 20px; line-height: 30px;">注意</h2>
+
+<p>在ES5中,如果这个方法的参数不是一个对象(一个原始类型),那么它会导致{{jsxref("TypeError")}}。在ES2015中,非对象参数将被视为是一个密封的普通对象,只返回<code>true</code>。</p>
+
+<pre class="brush: js notranslate">Object.isSealed(1);
+// TypeError: 1 is not an object (ES5 code)
+
+Object.isSealed(1);
+// true (ES2015 code)</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.11', 'Object.isSealed')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.<br>
+ Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.issealed', 'Object.isSealed')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.issealed', 'Object.isSealed')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">
+<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+</div>
+
+<p>{{Compat("javascript.builtins.Object.isSealed")}}</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.seal()")}}</li>
+ <li>{{jsxref("Object.preventExtensions()")}}</li>
+ <li>{{jsxref("Object.isExtensible()")}}</li>
+ <li>{{jsxref("Object.freeze()")}}</li>
+ <li>{{jsxref("Object.isFrozen()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html
new file mode 100644
index 0000000000..b477b88320
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html
@@ -0,0 +1,158 @@
+---
+title: Object.keys()
+slug: Web/JavaScript/Reference/Global_Objects/Object/keys
+tags:
+ - 'CCAC: Chrome Console Auto Copy'
+ - ECMAScript 5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/keys
+---
+<p>{{JSRef}}</p>
+
+<p><code><strong>Object.keys()</strong></code> 方法会返回一个由一个给定对象的自身可枚举属性组成的数组,数组中属性名的排列顺序和正常循环遍历该对象时返回的顺序一致 。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.keys(<var>obj</var>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt>obj</dt>
+ <dd>要返回其枚举自身属性的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>一个表示给定对象的所有可枚举属性的字符串数组。</p>
+
+<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2>
+
+<p><code>Object.keys</code> 返回一个所有元素为字符串的数组,其元素来自于从给定的<code>object</code>上面可直接枚举的属性。这些属性的顺序与手动遍历该对象属性时的一致。</p>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush: js">// simple array
+var arr = ['a', 'b', 'c'];
+console.log(Object.keys(arr)); // console: ['0', '1', '2']
+
+// array like object
+var obj = { 0: 'a', 1: 'b', 2: 'c' };
+console.log(Object.keys(obj)); // console: ['0', '1', '2']
+
+// array like object with random key ordering
+var anObj = { 100: 'a', 2: 'b', 7: 'c' };
+console.log(Object.keys(anObj)); // console: ['2', '7', '100']
+
+// getFoo is a property which isn't enumerable
+var myObj = Object.create({}, {
+ getFoo: {
+ value: function () { return this.foo; }
+ }
+});
+myObj.foo = 1;
+console.log(Object.keys(myObj)); // console: ['foo']</pre>
+
+<p>如果你想获取一个对象的所有属性,,甚至包括不可枚举的,请查看{{jsxref("Object.getOwnPropertyNames")}}。</p>
+
+<h2 id="注意">注意</h2>
+
+<p>在ES5里,如果此方法的参数不是对象(而是一个原始值),那么它会抛出 TypeError。在ES2015中,非对象的参数将被强制转换为一个对象。</p>
+
+<pre class="brush: js">Object.keys("foo");
+// TypeError: "foo" is not an object (ES5 code)
+
+Object.keys("foo");
+// ["0", "1", "2"] (ES2015 code)</pre>
+
+<h2 id="Polyfill">Polyfill</h2>
+
+<p>要在原生不支持的旧环境中添加兼容的<code>Object.keys</code>,请复制以下代码段:</p>
+
+<pre class="brush: js">if (!Object.keys) {
+ Object.keys = (function () {
+ var hasOwnProperty = Object.prototype.hasOwnProperty,
+ hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
+ dontEnums = [
+ 'toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'
+ ],
+ dontEnumsLength = dontEnums.length;
+
+ return function (obj) {
+ if (typeof obj !== 'object' &amp;&amp; typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object');
+
+ var result = [];
+
+ for (var prop in obj) {
+ if (hasOwnProperty.call(obj, prop)) result.push(prop);
+ }
+
+ if (hasDontEnumBug) {
+ for (var i=0; i &lt; dontEnumsLength; i++) {
+ if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]);
+ }
+ }
+ return result;
+ }
+ })()
+};
+</pre>
+
+<p>上面的代码在IE7(也许IE8也是)下有个问题,就是如果传入一个来自其他 window 对象下的对象时,不可枚举的属性也会获取到。</p>
+
+<p>另一个简单的实现,参见<a class="external" href="http://tokenposts.blogspot.com.au/2012/04/javascript-objectkeys-browser.html">Javascript - Object.keys Browser Compatibility</a>。</p>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.14', 'Object.keys')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.<br>
+ Implemented in JavaScript 1.8.5</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.keys', 'Object.keys')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.keys', 'Object.keys')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.builtins.Object.keys")}}</p>
+</div>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li><a href="https://developer.mozilla.org/en-US/docs/Enumerability_and_ownership_of_properties">Enumerability and ownership of properties</a></li>
+ <li>{{jsxref("Object.prototype.propertyIsEnumerable()")}}</li>
+ <li>{{jsxref("Object.create()")}}</li>
+ <li>{{jsxref("Object.getOwnPropertyNames()")}}</li>
+ <li>{{jsxref("Object.values()")}}</li>
+ <li>{{jsxref("Object.entries()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html
new file mode 100644
index 0000000000..7b54198c19
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/nosuchmethod/index.html
@@ -0,0 +1,208 @@
+---
+title: Object.prototype.__noSuchMethod__
+slug: Web/JavaScript/Reference/Global_Objects/Object/noSuchMethod
+translation_of: Archive/Web/JavaScript/Object.noSuchMethod
+---
+<div>{{JSRef}} {{obsolete_header}}</div>
+
+<p><strong><code>__noSuchMethod__</code></strong> 属性曾经是指当调用某个对象里不存在的方法时即将被执行的函数,但是现在这个函数已经不可用。</p>
+
+<p><code><font face="Open Sans, Arial, sans-serif">在</font><strong>__noSuchMethod__</strong></code> 属性被移除之后,ECMAScript 2015 (ES6) 规范转而采用 {{jsxref("Proxy")}} 对象, 可以实现下面的效果(以及更多)。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.__noSuchMethod__ = <var>fun</var></code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>fun</code></dt>
+ <dd>函数形式如下:</dd>
+ <dd>
+ <pre class="brush: js"><code>function (<var>id</var>, <var>args</var>) { . . . }</code></pre>
+
+ <dl>
+ <dt><code>id</code></dt>
+ <dd>调用的不存在的方法名</dd>
+ <dt><code>args</code></dt>
+ <dd>传递给该方法的参数数组</dd>
+ </dl>
+ </dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p>默认情况喜爱,试图调用对象上不存在的方法其结果是在{{jsxref("TypeError")}}上抛出异常,这种行为可以在</p>
+
+<p>By default, an attempt to call a method that doesn't exist on an object results in a {{jsxref("TypeError")}} being thrown. This behavior can be circumvented by defining a function at that object's <code>__noSuchMethod__</code> member. The function takes two arguments, the first is the name of the method attempted and the second is an array of the arguments that were passed in the method call. The second argument is an actual array (that is, it inherits through the {{jsxref("Array.prototype")}} chain) and not the array-like <a href="/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments" title="JavaScript/Reference/Functions/arguments">arguments object</a>.</p>
+
+<p>If this method cannot be called, either as if <code>undefined</code> by default, if deleted, or if manually set to a non-function, the JavaScript engine will revert to throwing <code>TypeError</code>s.</p>
+
+<h2 id="Examples">Examples</h2>
+
+<h3 id="Simple_test_of___noSuchMethod__">Simple test of <code>__noSuchMethod__</code></h3>
+
+<pre class="brush: js">var o = {
+ __noSuchMethod__: function(id, args) {
+ console.log(id, '(' + args.join(', ') + ')');
+ }
+};
+
+o.foo(1, 2, 3);
+o.bar(4, 5);
+o.baz();
+
+// Output
+// foo (1, 2, 3)
+// bar (4, 5)
+// baz ()
+</pre>
+
+<h3 id="Using___noSuchMethod___to_simulate_multiple_inheritance">Using <code>__noSuchMethod__</code> to simulate multiple inheritance</h3>
+
+<p>An example of code that implements a primitive form of multiple inheritance is shown below.</p>
+
+<pre class="brush: js">// Doesn't work with multiple inheritance objects as parents
+function noMethod(name, args) {
+ var parents = this.__parents_;
+
+ // Go through all parents
+ for (var i = 0; i &lt; parents.length; i++) {
+ // If we find a function on the parent, we call it
+ if (typeof parents[i][name] == "function") {
+ return parents[i][name].apply(this, args);
+ }
+ }
+
+ // If we get here, the method hasn't been found
+ throw new TypeError;
+}
+
+// Used to add a parent for multiple inheritance
+function addParent(obj, parent) {
+ // If the object isn't initialized, initialize it
+ if (!obj.__parents_) {
+ obj.__parents_ = [];
+ obj.__noSuchMethod__ = noMethod;
+ }
+
+ // Add the parent
+ obj.__parents_.push(parent);
+}
+</pre>
+
+<p>An example of using this idea is shown below.</p>
+
+<pre class="brush: js">// Example base class 1
+function NamedThing(name){
+ this.name=name;
+}
+
+NamedThing.prototype = {
+ getName: function() { return this.name; },
+ setName: function(newName) { this.name = newName; }
+}
+
+// Example base class 2
+function AgedThing(age) {
+ this.age = age;
+}
+
+AgedThing.prototype = {
+ getAge: function() { return this.age; },
+ setAge: function(age) { this.age = age; }
+}
+
+// Child class. inherits from NamedThing and AgedThing
+// as well as defining address
+function Person(name, age, address){
+ addParent(this, NamedThing.prototype);
+ NamedThing.call(this, name);
+ addParent(this, AgedThing.prototype);
+ AgedThing.call(this, age);
+ this.address = address;
+}
+
+Person.prototype = {
+ getAddr: function() { return this.address; },
+ setAddr: function(addr) { this.address = addr; }
+}
+
+var bob = new Person("bob", 25, "New York");
+
+console.log("getAge is " + (("getAge" in bob) ? "in" : "not in") + " bob");
+// getAge is not in bob
+
+console.log("bob's age is: " + bob.getAge());
+// bob's age is: 25
+
+console.log("getName is " + (("getName" in bob) ? "in" : "not in") + " bob");
+// getName is not in bob
+
+console.log("bob's name is: " + bob.getName());
+// bob's name is: bob
+
+console.log("getAddr is " + (("getAddr" in bob) ? "in" : "not in") + " bob");
+// getAddr is in bob
+
+console.log("bob's address is: " + bob.getAddr());
+// bob's address is: New York
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<p>Not part of any specifications. This feature has been removed, see {{bug(683218)}}.</p>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}} [1]</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}} [1]</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] This feature was implemented until version 43.</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/object/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/object/index.html
new file mode 100644
index 0000000000..ded4dfae16
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/object/index.html
@@ -0,0 +1,80 @@
+---
+title: Object() 构造函数
+slug: Web/JavaScript/Reference/Global_Objects/Object/Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/Object
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>Object</code> 构造函数将给定的值包装为一个新对象。</strong></p>
+
+<ul>
+ <li>如果给定的值是 {{jsxref("null")}} 或 {{jsxref("undefined")}}, 它会创建并返回一个空对象。</li>
+ <li>否则,它将返回一个和给定的值相对应的类型的对象。</li>
+ <li>如果给定值是一个已经存在的对象,则会返回这个已经存在的值(相同地址)。</li>
+</ul>
+
+<p>在非构造函数上下文中调用时, <code>Object</code> 和 <code>new Object()</code>表现一致。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">new Object()
+new Object(<var>value</var>)</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>value</code></dt>
+ <dd>任意值</dd>
+</dl>
+
+<h2 id="例子">例子</h2>
+
+<h3 id="创建一个新对象">创建一个新对象</h3>
+
+<pre>let o = new Object()
+o.foo = 42
+
+console.log(o)
+// Object { foo: 42 }
+</pre>
+
+<h3 id="使用_Object_创建_undefined_和_null_类型">使用 <code>Object</code> 创建 <code>undefined</code> 和 <code>null</code> 类型</h3>
+
+<p>下面的例子保存了一个空 <code>Object</code> 对象在 <code>o</code>:</p>
+
+<pre class="brush: js">let o = new Object()
+</pre>
+
+<pre class="brush: js">let o = new Object(undefined)
+</pre>
+
+<pre class="brush: js">let o = new Object(null)</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object-constructor', 'Object constructor')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.Object")}}</p>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer">Object initializer</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html
new file mode 100644
index 0000000000..e37cc6ab6f
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/observe/index.html
@@ -0,0 +1,160 @@
+---
+title: Object.observe()
+slug: Web/JavaScript/Reference/Global_Objects/Object/observe
+tags:
+ - ECMAScript7
+ - Experimental
+ - JavaScript
+ - Method
+ - Object
+ - observe
+translation_of: Archive/Web/JavaScript/Object.observe
+---
+<div>{{JSRef}} {{obsolete_header}}</div>
+
+<h2 id="概述">概述</h2>
+
+<p><strong><code>Object.observe()</code></strong> 方法用于异步地监视一个对象的修改。当对象属性被修改时,方法的回调函数会提供一个有序的修改流。然而,这个接口已经被废弃并从各浏览器中移除。你可以使用更通用的 {{jsxref("Proxy")}} 对象替代。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code>Object.observe(<var>obj</var>, <var>callback</var></code>[, <var>acceptList</var>])</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>被监控的对象.</dd>
+ <dt><code>callback</code></dt>
+ <dd>当对象被修改时触发的回调函数,其参数为:
+ <dl>
+ <dt><code>changes</code></dt>
+ <dd>一个数组,其中包含的每一个对象代表一个修改行为。每个修改行为的对象包含:
+ <ul>
+ <li><strong><code>name</code></strong>: 被修改的属性名称<span style="font-family: consolas,monaco,andale mono,monospace;">。</span></li>
+ <li><strong><code>object</code></strong>: 修改后该对象的值<span style="font-family: consolas,monaco,andale mono,monospace;">。</span></li>
+ <li><strong><code>type</code></strong>: 表示对该对象做了何种类型的修改,可能的值为<code>"add"</code>, <code>"update"</code>, or <code>"delete"</code><span style="font-family: consolas,monaco,andale mono,monospace;">。</span></li>
+ <li><strong><code>oldValue</code></strong>: 对象修改前的值。该值只在<code>"update"<font face="Open Sans, sans-serif">与</font></code><code>"delete"有效。</code></li>
+ <li> </li>
+ </ul>
+ </dd>
+ <dt><font face="Consolas">acceptList</font></dt>
+ <dd>在给定对象上给定回调中要监视的变化类型列表。如果省略, <code><font face="Courier New">["add", "update", "delete", "reconfigure", "setPrototype", "preventExtensions"]</font></code> 将会被使用。</dd>
+ </dl>
+ </dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p><code style="font-style: normal;">callback</code> 函数会在<code>对象被改变时被调用,其参数为一个包含所有修改信息的有序的数组对象。</code></p>
+
+<h2 id="例子">例子</h2>
+
+<h3 id="例子_打印出三种不同操作类型的日志">例子: 打印出三种不同操作类型的日志</h3>
+
+<pre class="brush: js">var obj = {
+ foo: 0,
+ bar: 1
+};
+
+Object.observe(obj, function(changes) {
+ console.log(changes);
+});
+
+obj.baz = 2;
+// [{name: 'baz', object: &lt;obj&gt;, type: 'add'}]
+
+obj.foo = 'hello';
+// [{name: 'foo', object: &lt;obj&gt;, type: 'update', oldValue: 0}]
+
+delete obj.baz;
+// [{name: 'baz', object: &lt;obj&gt;, type: 'delete', oldValue: 2}]
+</pre>
+
+<h3 id="例子_数据绑定">例子: 数据绑定</h3>
+
+<pre class="brush: js">// 一个数据模型
+var user = {
+ id: 0,
+ name: 'Brendan Eich',
+ title: 'Mr.'
+};
+
+// 创建用户的greeting
+function updateGreeting() {
+ user.greeting = 'Hello, ' + user.title + ' ' + user.name + '!';
+}
+updateGreeting();
+
+Object.observe(user, function(changes) {
+ changes.forEach(function(change) {
+ // 当name或title属性改变时, 更新greeting
+ if (change.name === 'name' || change.name === 'title') {
+ updateGreeting();
+ }
+ });
+});
+</pre>
+
+<h2 id="Specifications" name="Specifications">规范</h2>
+
+<p><a href="https://github.com/arv/ecmascript-object-observe">Strawman proposal for ECMAScript 7</a>.</p>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome("36")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("23")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatChrome("36")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("23")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.unobserve()")}} {{experimental_inline}}</li>
+ <li>{{jsxref("Array.observe()")}} {{experimental_inline}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html
new file mode 100644
index 0000000000..8597b6c4a3
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/parent/index.html
@@ -0,0 +1,43 @@
+---
+title: Object.prototype.__parent__
+slug: Web/JavaScript/Reference/Global_Objects/Object/Parent
+tags:
+ - JavaScript
+ - 原型
+ - 对象
+ - 属性
+ - 已废弃
+ - 非标准
+translation_of: Archive/Web/JavaScript/Object.parent
+---
+<div>{{JSRef}}{{Non-standard_Header}}{{Obsolete_Header("gecko2")}}</div>
+
+<p>The <strong><code>__parent__</code></strong> property used to point to an object's context, but it has been removed.</p>
+
+<p>指向一个对象的上下文.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><var>obj</var>.__parent__</pre>
+
+<h2 id="描述">描述</h2>
+
+<p>对于最顶层对象来说,这个属性的值就是全局对象 window。</p>
+
+<h2 id="规范">规范</h2>
+
+<p>不属于任何规范。</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("javascript.builtins.Object.parent")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a class="external" href="http://whereswalden.com/2010/05/07/spidermonkey-change-du-jour-the-special-__parent__-property-has-been-removed/">SpiderMonkey change du jour: the special __parent__ property has been removed</a></li>
+ <li><a href="/zh-CN/docs/Components.utils.getGlobalForObject">Components.utils.getGlobalForObject</a></li>
+ <li><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/Proto">__proto__</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
new file mode 100644
index 0000000000..81c8a451a2
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
@@ -0,0 +1,131 @@
+---
+title: Object.preventExtensions()
+slug: Web/JavaScript/Reference/Global_Objects/Object/preventExtensions
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/preventExtensions
+---
+<div>{{JSRef("Global_Objects", "Object")}}</div>
+
+<p><code><strong>Object.preventExtensions()</strong></code>方法让一个对象变的不可扩展,也就是永远不能再添加新的属性。</p>
+
+<p>{{EmbedInteractiveExample("pages/js/object-preventextensions.html")}}</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.preventExtensions(<em>obj</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>将要变得不可扩展的对象。</dd>
+ <dt>
+ <h3 id="返回值">返回值</h3>
+ </dt>
+ <dd>已经不可扩展的对象。</dd>
+</dl>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>如果一个对象可以添加新的属性,则这个对象是可扩展的。<code>Object.preventExtensions()</code>将对象标记为不再可扩展,这样它将永远不会具有它被标记为不可扩展时持有的属性之外的属性。注意,一般来说,不可扩展对象的属性可能仍然可被<em>删除</em>。尝试将新属性添加到不可扩展对象将静默失败或抛出{{jsxref("TypeError")}}(最常见的情况是{{jsxref("Functions_and_function_scope/Strict_mode", "strict mode", "", 1)}}中,但不排除其他情况)。</p>
+
+<p><code>Object.preventExtensions()</code>仅阻止添加自身的属性。但其对象类型的原型依然可以添加新的属性。</p>
+
+<p>该方法使得目标对象的 <code>[[prototype]]</code>  不可变;任何重新赋值 <code>[[prototype]]</code> 操作都会抛出 <code>TypeError</code> 。这种行为只针对内部的 <code>[[prototype]]</code> 属性, 目标对象的其它属性将保持可变。</p>
+
+<p>一旦将对象变为不可扩展的对象,就再也不能使其可扩展。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<pre class="brush: js">// Object.preventExtensions将原对象变的不可扩展,并且返回原对象.
+var obj = {};
+var obj2 = Object.preventExtensions(obj);
+obj === obj2; // true
+
+// 字面量方式定义的对象默认是可扩展的.
+var empty = {};
+Object.isExtensible(empty) //=== true
+
+// ...但可以改变.
+Object.preventExtensions(empty);
+Object.isExtensible(empty) //=== false
+
+// 使用Object.defineProperty方法为一个不可扩展的对象添加新属性会抛出异常.
+var nonExtensible = { removable: true };
+Object.preventExtensions(nonExtensible);
+Object.defineProperty(nonExtensible, "new", { value: 8675309 }); // 抛出TypeError异常
+
+// 在严格模式中,为一个不可扩展对象的新属性赋值会抛出TypeError异常.
+function fail()
+{
+ "use strict";
+ nonExtensible.newProperty = "FAIL"; // throws a TypeError
+}
+fail();
+</pre>
+
+<p>​​​​</p>
+
+<p>不可扩展对象的原型是不可变的:</p>
+
+<pre>var fixed = Object.preventExtensions({});
+// throws a 'TypeError'.
+fixed.__proto__ = { oh: 'hai' };</pre>
+
+<h2 id="Notes">Notes</h2>
+
+<p>在 ES5 中,如果参数不是一个对象类型(而是原始类型),将抛出一个{{jsxref("TypeError")}}异常。在 ES2015 中,非对象参数将被视为一个不可扩展的普通对象,因此会被直接返回。</p>
+
+<pre class="brush: js">Object.preventExtensions(1);
+// TypeError: 1 is not an object (ES5 code)
+
+Object.preventExtensions(1);
+// 1 (ES2015 code)</pre>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.10', 'Object.preventExtensions')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.5.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.preventextensions', 'Object.preventExtensions')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.preventextensions', 'Object.preventExtensions')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.preventExtensions")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.isExtensible()")}}</li>
+ <li>{{jsxref("Object.seal()")}}</li>
+ <li>{{jsxref("Object.isSealed()")}}</li>
+ <li>{{jsxref("Object.freeze()")}}</li>
+ <li>{{jsxref("Object.isFrozen()")}}</li>
+ <li>{{jsxref("Reflect.preventExtensions()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/propertyisenumerable/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/propertyisenumerable/index.html
new file mode 100644
index 0000000000..b74e6bc26b
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/propertyisenumerable/index.html
@@ -0,0 +1,146 @@
+---
+title: Object.prototype.propertyIsEnumerable()
+slug: Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Prototype
+ - 对象
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>propertyIsEnumerable()</strong></code> 方法返回一个布尔值,表示指定的属性是否可枚举。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-prototype-propertyisenumerable.html")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.propertyIsEnumerable(<var>prop</var>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>prop</code></dt>
+ <dd>需要测试的属性名。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>用来表示指定的属性名是否可枚举的{{jsxref("Boolean", "布尔值")}}。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>每个对象都有一个 <code>propertyIsEnumerable</code> 方法。此方法可以确定对象中指定的属性是否可以被 {{jsxref("Statements/for...in", "for...in")}} 循环枚举,但是通过原型链继承的属性除外。如果对象没有指定的属性,则此方法返回 <code>false</code>。</p>
+
+<h2 id="例子">例子</h2>
+
+<h3 id="propertyIsEnumerable_方法的基本用法"><code>propertyIsEnumerable</code> 方法的基本用法</h3>
+
+<p>下面的例子演示了 <code>propertyIsEnumerable</code> 方法在普通对象和数组上的基本用法:</p>
+
+<pre class="brush: js">var o = {};
+var a = [];
+o.prop = 'is enumerable';
+a[0] = 'is enumerable';
+
+o.propertyIsEnumerable('prop'); // 返回 true
+a.propertyIsEnumerable(0); // 返回 true</pre>
+
+<h3 id="用户自定义对象和内置对象">用户自定义对象和内置对象</h3>
+
+<p>下面的例子演示了用户自定义对象和内置对象上属性可枚举性的区别.</p>
+
+<pre class="brush: js">var a = ['is enumerable'];
+
+a.propertyIsEnumerable(0); // 返回 true
+a.propertyIsEnumerable('length'); // 返回 false
+
+Math.propertyIsEnumerable('random'); // 返回 false
+this.propertyIsEnumerable('Math'); // 返回 false</pre>
+
+<h3 id="自身属性和继承属性">自身属性和继承属性</h3>
+
+<pre class="brush: js">var a = [];
+a.propertyIsEnumerable('constructor'); // 返回 false
+
+function firstConstructor() {
+ this.property = 'is not enumerable';
+}
+
+firstConstructor.prototype.firstMethod = function() {};
+
+function secondConstructor() {
+ this.method = function method() { return 'is enumerable'; };
+}
+
+secondConstructor.prototype = new firstConstructor;
+secondConstructor.prototype.constructor = secondConstructor;
+
+var o = new secondConstructor();
+o.arbitraryProperty = 'is enumerable';
+
+o.propertyIsEnumerable('arbitraryProperty'); // 返回 true
+o.propertyIsEnumerable('method'); // 返回 true
+o.propertyIsEnumerable('property'); // 返回 false
+
+o.property = 'is enumerable';
+
+o.propertyIsEnumerable('property'); // 返回 true
+
+// 之所以这些会返回 false,是因为,在原型链上 propertyIsEnumerable 不被考虑
+// (尽管最后两个在 for-in 循环中可以被循环出来)。
+o.propertyIsEnumerable('prototype'); // 返回 false (根据 JS 1.8.1/FF3.6)
+o.propertyIsEnumerable('constructor'); // 返回 false
+o.propertyIsEnumerable('firstMethod'); // 返回 false</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES3')}}</td>
+ <td>{{Spec2('ES3')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.7', 'Object.prototype.propertyIsEnumerable')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.propertyisenumerable', 'Object.prototype.propertyIsEnumerable')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.propertyisenumerable', 'Object.prototype.propertyIsEnumerable')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.propertyIsEnumerable")}}</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Enumerability_and_ownership_of_properties">属性的可枚举性和所有权</a></li>
+ <li>{{jsxref("Statements/for...in", "for...in")}}</li>
+ <li>{{jsxref("Object.keys()")}}</li>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/proto/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/proto/index.html
new file mode 100644
index 0000000000..7a9d4dfefd
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/proto/index.html
@@ -0,0 +1,142 @@
+---
+title: Object.prototype.__proto__
+slug: Web/JavaScript/Reference/Global_Objects/Object/proto
+tags:
+ - ECMAScript 2015
+ - JavaScript
+ - Object
+ - Property
+ - Prototype
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/proto
+---
+<div>{{JSRef}}{{Deprecated_header}}</div>
+
+<div class="warning">
+<p><strong>警告:</strong> 通过现代浏览器的操作属性的便利性,可以改变一个对象的 <code>[[Prototype]]</code> 属性, 这种行为在每一个JavaScript引擎和浏览器中都是一个非常慢且影响性能的操作,使用这种方式来改变和继承属性是对性能影响非常严重的,并且性能消耗的时间也不是简单的花费在 <code>obj.__proto__ = ...</code> 语句上, 它还会影响到所有继承来自该 <code>[[Prototype]]</code> 的对象,如果你关心性能,你就不应该在一个对象中修改它的 [[Prototype]]。相反, 创建一个新的且可以继承 <code>[[Prototype]]</code> 的对象,推荐使用 {{jsxref("Object.create()")}}。</p>
+</div>
+
+<div class="warning">
+<p><strong>警告:</strong> 当<code>Object.prototype.__proto__</code> 已被大多数浏览器厂商所支持的今天,其存在和确切行为仅在ECMAScript 2015规范中被标准化为传统功能,以确保Web浏览器的兼容性。为了更好的支持,建议只使用 {{jsxref("Object.getPrototypeOf()")}}。</p>
+</div>
+
+<div>{{jsxref("Object.prototype")}} 的 <code>__proto__</code>  属性是一个访问器属性(一个getter函数和一个setter函数), 暴露了通过它访问的对象的内部<code>[[Prototype]]</code> (一个对象或 {{jsxref("Global_Objects/null", "null")}})。</div>
+
+<div></div>
+
+<p>使用<code>__proto__</code>是有争议的,也不鼓励使用它。因为它从来没有被包括在EcmaScript语言规范中,但是现代浏览器都实现了它。<code>__proto__</code>属性已在ECMAScript 6语言规范中标准化,用于确保Web浏览器的兼容性,因此它未来将被支持。它已被不推荐使用, 现在更推荐使用{{jsxref("Object.getPrototypeOf")}}/{{jsxref("Reflect.getPrototypeOf")}} 和{{jsxref("Object.setPrototypeOf")}}/{{jsxref("Reflect.setPrototypeOf")}}(尽管如此,设置对象的[[Prototype]]是一个缓慢的操作,如果性能是一个问题,应该避免)。</p>
+
+<p>__proto__ 属性也可以在对象文字定义中使用对象[[Prototype]]来创建,作为{{jsxref("Object.create()")}} 的一个替代。 请参阅: <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer">object initializer / literal syntax</a>.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush: js">let Circle = function () {};
+let shape = {};
+let circle = new Circle();
+
+// 设置该对象的原型链引用
+// 过时且不推荐使用的。这里只是举个例子,尽量不要在生产环境中这样做。
+shape.__proto__ = circle;
+
+// 判断该对象的原型链引用是否属于circle
+console.log(shape.__proto__ === circle); // true
+</pre>
+
+<pre class="brush: js">let shape = function () {};
+let p = {
+ a: function () {
+ console.log('aaa');
+ }
+};
+shape.prototype.__proto__ = p;
+
+let circle = new shape();
+circle.a();//aaa
+console.log(shape.prototype === circle.__proto__);//true
+
+//或者
+let shape = function () {};
+var p = {
+ a: function () {
+ console.log('a');
+ }
+};
+
+let circle = new shape();
+circle.__proto__ = p;
+circle.a(); // a
+console.log(shape.prototype === circle.__proto__);//false
+
+//或者
+function test() {}
+test.prototype.myname = function () {
+ console.log('myname');
+}
+let a = new test()
+console.log(a.__proto__ === test.prototype);//true
+a.myname();//myname
+
+//或者
+let fn = function () {};
+fn.prototype.myname = function () {
+ console.log('myname');
+}
+
+let obj = {
+ __proto__: fn.prototype
+};
+
+obj.myname();//myname
+</pre>
+
+<p>注意:这是两个下划线,后面是五个字符的 “proto” ,后面再跟两个下划线。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>__proto__的读取器(getter)暴露了一个对象的内部 <code>[[Prototype]]</code> 。对于使用对象字面量创建的对象,这个值是 {{jsxref("Object.prototype")}}。对于使用数组字面量创建的对象,这个值是 {{jsxref("Array.prototype")}}。对于functions,这个值是{{jsxref("Function.prototype")}}。对于使用 new fun 创建的对象,其中fun是由js提供的内建构造器函数之一({{jsxref("Array")}}, {{jsxref("Boolean")}}, {{jsxref("Date")}}, {{jsxref("Number")}}, {{jsxref("Object")}}, {{jsxref("String")}} 等等),这个值总是fun.prototype。对于用js定义的其他js构造器函数创建的对象,这个值就是该构造器函数的prototype属性。</p>
+
+<p>__proto__ 的设置器(setter)允许对象的 <code>[[Prototype]]被变更。前提是这个对象必须通过</code> {{jsxref("Object.isExtensible()")}} 判断为是可扩展的,如果不可扩展,则会抛出一个 {{jsxref("Global_Objects/TypeError", "TypeError")}} 错误。要变更的值必须是一个object或{{jsxref("Global_Objects/null", "null")}},提供其它值将不起任何作用。</p>
+
+<p>要理解原型如何被使用,请查看相关文章:<a href="/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a>。</p>
+
+<p>.__proto__属性是{{jsxref("Object.prototype")}} 一个简单的访问器属性,其中包含了get(获取)和set(设置)的方法,任何一个__proto__的存取属性都继承于{{jsxref("Object.prototype")}},但一个访问属性如果不是来源于{{jsxref("Object.prototype")}}就不拥有.__proto__属性,譬如一个元素设置了其他的.__proto__属性在{{jsxref("Object.prototype")}}之前,将会覆盖原有的{{jsxref("Object.prototype")}}。</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-additional-properties-of-the-object.prototype-object', 'Object.prototype.__proto__')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Included in the (normative) annex for additional ECMAScript legacy features for Web browsers (note that the specification codifies what is already in implementations).</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-additional-properties-of-the-object.prototype-object', 'Object.prototype.__proto__')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容情况">浏览器兼容情况</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.proto")}}</p>
+
+<h2 id="兼容性注意事项">兼容性注意事项</h2>
+
+<p>在 ECMAScript 2015(ES6)的规范要求中,支持<code>__proto__</code> 是各大Web浏览器厂商的要求(虽然符合规范),但其他环境下因为历史遗留的问题,也有可能被使用和支持。 </p>
+
+<h2 id="更多请参考">更多请参考</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.isPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.getPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.setPrototypeOf()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/prototype/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/prototype/index.html
new file mode 100644
index 0000000000..c3a7d022f7
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/prototype/index.html
@@ -0,0 +1,194 @@
+---
+title: Object.prototype
+slug: Web/JavaScript/Reference/Global_Objects/Object/prototype
+tags:
+ - JavaScript
+ - Object
+ - Property
+translation_of: Web/JavaScript/Reference/Global_Objects/Object
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.prototype</strong></code> 属性表示 {{jsxref("Object")}} 的原型对象。</p>
+
+<p>{{js_property_attributes(0, 0, 0)}}</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>几乎所有的 JavaScript 对象都是 {{jsxref("Object")}} 的实例;一个典型的对象继承了<code>Object.prototype</code>的属性(包括方法),尽管这些属性可能被遮蔽(亦称为覆盖)。但是有时候可能故意创建不具有典型原型链继承的对象,比如通过{{jsxref("Object.create", "Object.create(null)")}}创建的对象,或者通过{{jsxref("Object.setPrototypeOf")}}方法改变原型链。</p>
+
+<p>改变<code>Object</code>原型,会通过原型链改变<strong>所有</strong>对象;除非在原型链中进一步覆盖受这些变化影响的属性和方法。这提供了一个非常强大的、但有潜在危险的机制来覆盖或扩展对象行为。</p>
+
+<h2 id="Properties" name="Properties">属性</h2>
+
+<dl>
+ <dt>{{jsxref("Object.prototype.constructor")}}</dt>
+ <dd>特定的函数,用于创建一个对象的原型。</dd>
+ <dt>{{jsxref("Object.prototype.__proto__")}} {{non-standard_inline}}</dt>
+ <dd>指向当对象被实例化的时候,用作原型的对象。</dd>
+ <dt>{{jsxref("Object.prototype.__noSuchMethod__")}} {{non-standard_inline}}</dt>
+ <dd>当未定义的对象成员被调用作方法的时候,允许定义并执行的函数。</dd>
+ <dt><s class="obsoleteElement">{{jsxref("Object.prototype.__count__")}} {{obsolete_inline}}</s></dt>
+ <dd><s class="obsoleteElement">用于直接返回用户定义的对象中可数的属性的数量。已被废除。</s></dd>
+ <dt><s class="obsoleteElement">{{jsxref("Object.prototype.__parent__")}} {{obsolete_inline}}</s></dt>
+ <dd><s class="obsoleteElement">用于指向对象的内容。已被废除。</s></dd>
+</dl>
+
+<h2 id="Methods" name="Methods">方法</h2>
+
+<dl>
+ <dt>{{jsxref("Object.prototype.__defineGetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt>
+ <dd>关联一个函数到一个属性。访问该函数时,执行该函数并返回其返回值。</dd>
+ <dt>{{jsxref("Object.prototype.__defineSetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt>
+ <dd>关联一个函数到一个属性。设置该函数时,执行该修改属性的函数。</dd>
+ <dt>{{jsxref("Object.prototype.__lookupGetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt>
+ <dd>返回使用 {{jsxref("Object.defineGetter", "__defineGetter__")}} 定义的方法函数 。</dd>
+ <dt>{{jsxref("Object.prototype.__lookupSetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt>
+ <dd>返回使用 {{jsxref("Object.defineSetter", "__defineSetter__")}} 定义的方法函数。</dd>
+ <dt>{{jsxref("Object.prototype.hasOwnProperty()")}}</dt>
+ <dd>返回一个布尔值 ,表示某个对象是否含有指定的属性,而且此属性非原型链继承的。</dd>
+ <dt>{{jsxref("Object.prototype.isPrototypeOf()")}}</dt>
+ <dd>返回一个布尔值,表示指定的对象是否在本对象的原型链中。</dd>
+ <dt>{{jsxref("Object.prototype.propertyIsEnumerable()")}}</dt>
+ <dd>判断指定属性是否可枚举,内部属性设置参见 <a href="/zh-CN/docs/Web/JavaScript/Data_structures#Properties">ECMAScript [[Enumerable]] attribute</a> 。</dd>
+ <dt>{{jsxref("Object.prototype.toSource()")}} {{non-standard_inline}}</dt>
+ <dd>返回字符串表示此对象的源代码形式,可以使用此字符串生成一个新的相同的对象。</dd>
+ <dt>{{jsxref("Object.prototype.toLocaleString()")}}</dt>
+ <dd>直接调用 {{jsxref("Object.toString", "toString()")}}方法。</dd>
+ <dt>{{jsxref("Object.prototype.toString()")}}</dt>
+ <dd>返回对象的字符串表示。</dd>
+ <dt>{{jsxref("Object.prototype.unwatch()")}} {{non-standard_inline}}</dt>
+ <dd>移除对象某个属性的监听。</dd>
+ <dt>{{jsxref("Object.prototype.valueOf()")}}</dt>
+ <dd>返回指定对象的原始值。</dd>
+ <dt>{{jsxref("Object.prototype.watch()")}} {{non-standard_inline}}</dt>
+ <dd>给对象的某个属性增加监听。</dd>
+ <dt><s class="obsoleteElement">{{jsxref("Object.prototype.eval()")}} {{obsolete_inline}}</s></dt>
+ <dd><s class="obsoleteElement">在指定对象为上下文情况下执行javascript字符串代码,已经废弃。</s></dd>
+</dl>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<p>当改变现有的 Object.prototype method(方法)的行为时,考虑在现有逻辑之前或之后通过封装你的扩展来注入代码。例如,此(未测试的)代码将在内置逻辑或其他人的扩展执行之前 pre-conditionally(预条件地)执行自定义逻辑。</p>
+
+<p>当一个函数被调用时,调用的参数被保留在类似数组 "变量" 的<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments">参数</a>中。例如, 在调用 "myFn (a、b、c)"时, 在myFn 的主体内的参数将包含 3个类似数组的元素对应于 (a、b、c)。 使用钩子修改原型时,只需通过调用该函数的 apply (),将 this 与参数 (调用状态) 传递给当前行为。这种模式可以用于任何原型,如 Node.prototype、 Function.prototype 等.</p>
+
+<pre class="brush: js">var current = Object.prototype.valueOf;
+
+// 由于我的属性 "-prop-value"是交叉性的, 并不总是
+// 在同一个原型链上,我想要修改 Object.prototype:
+Object.prototype.valueOf = function() {
+ if (this.hasOwnProperty('-prop-value')) {
+ return this['-prop-value'];
+ } else {
+ // <code>它看起来不像我的对象之一,因此,让我们退回到</code>
+ // <code>默认行为,通过尽可能地复制当前行为来实现.</code>
+ // <code>此apply的行为类似于其他语言中的"super"</code>.
+ // <code>即使 valueOf() 不带参数, 其他的钩子可能会带有.</code>
+ return current.apply(this, arguments);
+ }
+}</pre>
+
+<p>由于 JavaScript 并不完全具有子类对象, 所以原型是一种有用的变通方法, 可以使用某些函数的 "基类" 对象来充当对象。例如:</p>
+
+<pre class="brush: js">var Person = function(name) {
+ this.name = name;
+ this.canTalk = true;
+};
+
+Person.prototype.greet = function() {
+ if (this.canTalk) {
+ console.log('Hi, I am ' + this.name);
+ }
+};
+
+var Employee = function(name, title) {
+ Person.call(this, name);
+ this.title = title;
+};
+
+Employee.prototype = Object.create(Person.prototype);
+
+Employee.prototype.greet = function() {
+ if (this.canTalk) {
+ console.log('Hi, I am ' + this.name + ', the ' + this.title);
+ }
+};
+
+var Customer = function(name) {
+ Person.call(this, name);
+};
+
+Customer.prototype = Object.create(Person.prototype);
+
+var Mime = function(name) {
+ Person.call(this, name);
+ this.canTalk = false;
+};
+
+Mime.prototype = Object.create(Person.prototype);
+
+var bob = new Employee('Bob', 'Builder');
+var joe = new Customer('Joe');
+var rg = new Employee('Red Green', 'Handyman');
+var mike = new Customer('Mike');
+var mime = new Mime('Mime');
+
+bob.greet();
+// Hi, I am Bob, the Builder
+
+joe.greet();
+// Hi, I am Joe
+
+rg.greet();
+// Hi, I am Red Green, the Handyman
+
+mike.greet();
+// Hi, I am Mike
+
+mime.greet();
+</pre>
+
+<h2 id="Specifications" name="Specifications">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.0.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.1', 'Object.prototype')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype', 'Object.prototype')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype', 'Object.prototype')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.prototype")}}</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript">Introduction to Object-Oriented JavaScript</a></li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html
new file mode 100644
index 0000000000..7a18ee2e91
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html
@@ -0,0 +1,151 @@
+---
+title: Object.seal()
+slug: Web/JavaScript/Reference/Global_Objects/Object/seal
+tags:
+ - ECMAScript 5
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/seal
+---
+<div>{{JSRef}}</div>
+
+<div><code><strong>Object.seal()</strong></code>方法封闭一个对象,阻止添加新属性并将所有现有属性标记为不可配置。当前属性的值只要原来是可写的就可以改变。</div>
+
+<div></div>
+
+<div>{{EmbedInteractiveExample("pages/js/object-prototype-seal.html")}}</div>
+
+
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.seal(<em>obj</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>将要被密封的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>被密封的对象。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>通常,一个对象是{{jsxref("Object.isExtensible()", "可扩展的", "", 1)}}(可以添加新的属性)。密封一个对象会让这个对象变的不能添加新属性,且所有已有属性会变的不可配置。属性不可配置的效果就是属性变的不可删除,以及一个数据属性不能被重新定义成为访问器属性,或者反之。但属性的值仍然可以修改。尝试删除一个密封对象的属性或者将某个密封对象的属性从数据属性转换成访问器属性,结果会静默失败或抛出{{jsxref("TypeError")}}(在{{jsxref("Strict_mode", "严格模式", "", 1)}} 中最常见的,但不唯一)。</p>
+
+<p>不会影响从原型链上继承的属性。但 {{jsxref("Object.proto", "__proto__")}} ( {{deprecated_inline}} ) 属性的值也会不能修改。</p>
+
+<p>返回被密封对象的引用。</p>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<pre class="brush: js">var obj = {
+ prop: function() {},
+ foo: 'bar'
+};
+
+// 可以添加新的属性
+// 可以更改或删除现有的属性
+obj.foo = 'baz';
+obj.lumpy = 'woof';
+delete obj.prop;
+
+var o = Object.seal(obj);
+
+o === obj; // true
+Object.isSealed(obj); // === true
+
+// 仍然可以修改密封对象的属性值
+obj.foo = 'quux';
+
+
+// 但是你不能将属性重新定义成为访问器属性
+// 反之亦然
+Object.defineProperty(obj, 'foo', {
+ get: function() { return 'g'; }
+}); // throws a TypeError
+
+// 除了属性值以外的任何变化,都会失败.
+obj.quaxxor = 'the friendly duck';
+// 添加属性将会失败
+delete obj.foo;
+// 删除属性将会失败
+
+// 在严格模式下,这样的尝试将会抛出错误
+function fail() {
+ 'use strict';
+ delete obj.foo; // throws a TypeError
+ obj.sparky = 'arf'; // throws a TypeError
+}
+fail();
+
+// 通过Object.defineProperty添加属性将会报错
+Object.defineProperty(obj, 'ohai', {
+ value: 17
+}); // throws a TypeError
+Object.defineProperty(obj, 'foo', {
+ value: 'eit'
+}); // 通过Object.defineProperty修改属性值</pre>
+
+<h2 id="注意">注意</h2>
+
+<p>在ES5中,如果这个方法的参数不是一个(原始)对象,那么它将导致{{jsxref("TypeError")}}。在ES2015中,非对象参数将被视为已被密封的普通对象,会直接返回它。</p>
+
+<pre class="brush: js">Object.seal(1);
+// TypeError: 1 is not an object (ES5 code)
+
+Object.seal(1);
+// 1 (ES2015 code)</pre>
+
+<h3 id="对比_Object.freeze">对比 <code>Object.freeze()</code></h3>
+
+<p>使用<code>Object.freeze()</code>冻结的对象中的现有属性值是不可变的。用<code>Object.seal()</code>密封的对象可以改变其现有属性值。</p>
+
+<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.3.8', 'Object.seal')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.5.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.seal', 'Object.seal')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.seal', 'Object.seal')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.builtins.Object.seal")}}</p>
+</div>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.isSealed()")}}</li>
+ <li>{{jsxref("Object.preventExtensions()")}}</li>
+ <li>{{jsxref("Object.isExtensible()")}}</li>
+ <li>{{jsxref("Object.freeze()")}}</li>
+ <li>{{jsxref("Object.isFrozen()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/setprototypeof/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/setprototypeof/index.html
new file mode 100644
index 0000000000..20d34f2b92
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/setprototypeof/index.html
@@ -0,0 +1,233 @@
+---
+title: Object.setPrototypeOf()
+slug: Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
+tags:
+ - Array
+ - Class
+ - ECMAScript6
+ - ES6
+ - JavaScript
+ - Object.setPrototypeOf()
+ - Typescript
+ - setPrototypeOf()
+ - 对象
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
+---
+<div>{{JSRef}}</div>
+
+<div><strong>Object.setPrototypeOf() </strong>方法设置一个指定的对象的原型 ( 即, 内部[[Prototype]]属性)到另一个对象或  {{jsxref("null")}}。</div>
+
+<div></div>
+
+<div class="warning">
+<p><strong>警告:</strong> 由于现代 JavaScript 引擎优化属性访问所带来的特性的关系,更改对象的 <code>[[Prototype]]</code>在<em><strong>各个</strong></em>浏览器和 JavaScript 引擎上都是一个很慢的操作。其在更改继承的性能上的影响是微妙而又广泛的,这不仅仅限于 <code>obj.__proto__ = ...</code> 语句上的时间花费,而且可能会延伸到<em><strong>任何</strong></em>代码,那些可以访问<em><strong>任何</strong></em><code>[[Prototype]]</code>已被更改的对象的代码。如果你关心性能,你应该避免设置一个对象的 <code>[[Prototype]]</code>。相反,你应该使用 {{jsxref("Object.create()")}}来创建带有你想要的<code>[[Prototype]]</code>的新对象。</p>
+</div>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code>Object.setPrototypeOf(<em>obj, prototype</em>)</code></pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt>obj</dt>
+ <dd>要设置其原型的对象。.</dd>
+ <dt>prototype</dt>
+ <dd>该对象的新原型(一个对象 或 {{jsxref("null")}}).</dd>
+</dl>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>如果对象的[[Prototype]]被修改成不可扩展(通过 {{jsxref("Object.isExtensible()")}}查看),就会抛出 {{jsxref("TypeError")}}异常。如果<code>prototype</code>参数不是一个对象或者{{jsxref("null")}}(例如,数字,字符串,boolean,或者 {{jsxref("undefined")}}),则什么都不做。否则,该方法将<code>obj</code>的<code>[[Prototype]]</code>修改为新的值。</p>
+
+<p><code>Object.setPrototypeOf()是</code>ECMAScript 6最新草案中的方法,相对于 {{jsxref("Object.prototype.__proto__")}} ,它被认为是修改对象原型更合适的方法</p>
+
+<h2 id="示例">示例</h2>
+
+<pre><code>var dict = Object.setPrototypeOf({}, null);</code></pre>
+
+<h2 id="Notes" name="Notes">Polyfill</h2>
+
+<p><span class="short_text" id="result_box" lang="en"><span>我们必须借助非标准的</span> </span> </p>
+
+<p>使用较旧的 {{jsxref("Object.prototype.__proto__")}} 属性,我们可以很容易地定义Object.setPrototypeOf 如果它不可用:</p>
+
+<pre>if (!Object.setPrototypeOf) {
+ // 仅适用于Chrome和FireFox,在IE中不工作:
+ Object.prototype.setPrototypeOf = function(obj, proto) {
+ if(obj.__proto__) {
+ obj.__proto__ = proto;
+ return obj;
+ } else {
+ // 如果你想返回 prototype of Object.create(null):
+ var Fn = function() {
+ for (var key in obj) {
+ Object.defineProperty(this, key, {
+ value: obj[key],
+ });
+ }
+ };
+ Fn.prototype = proto;
+ return new Fn();
+ }
+ }
+}
+</pre>
+
+
+
+<h2 id="附加原型链">附加原型链</h2>
+
+<p>通过  <code>Object.getPrototypeOf() 和</code> {{jsxref("Object.proto", "Object.prototype.__proto__")}} 的组合允许将一个原型链完整的附加到一个新的原型对象上:</p>
+
+<pre class="brush: js">/**
+*** Object.appendChain(@object, @prototype)
+*
+* Appends the first non-native prototype of a chain to a new prototype.
+* Returns @object (if it was a primitive value it will transformed into an object).
+*
+*** Object.appendChain(@object [, "@arg_name_1", "@arg_name_2", "@arg_name_3", "..."], "@function_body")
+*** Object.appendChain(@object [, "@arg_name_1, @arg_name_2, @arg_name_3, ..."], "@function_body")
+*
+* Appends the first non-native prototype of a chain to the native Function.prototype object, then appends a
+* new Function(["@arg"(s)], "@function_body") to that chain.
+* Returns the function.
+*
+**/
+
+Object.appendChain = function(oChain, oProto) {
+ if (arguments.length &lt; 2) {
+ throw new TypeError('Object.appendChain - Not enough arguments');
+ }
+ if (typeof oProto === 'number' || typeof oProto === 'boolean') {
+ throw new TypeError('second argument to Object.appendChain must be an object or a string');
+ }
+
+ var oNewProto = oProto,
+  oReturn,
+  o2nd,
+  oLast;
+
+ oReturn = o2nd = oLast = oChain instanceof this ? oChain : new oChain.constructor(oChain);
+
+ for (var o1st = this.getPrototypeOf(o2nd);
+ o1st !== Object.prototype &amp;&amp; o1st !== Function.prototype;
+ o1st = this.getPrototypeOf(o2nd)
+ ) {
+ o2nd = o1st;
+ }
+
+ if (oProto.constructor === String) {
+ oNewProto = Function.prototype;
+ oReturn = Function.apply(null, Array.prototype.slice.call(arguments, 1));
+ this.setPrototypeOf(oReturn, oLast);
+ }
+
+ this.setPrototypeOf(o2nd, oNewProto);
+ return oReturn;
+}</pre>
+
+<h2 id="使用">使用</h2>
+
+<p>例子一:向一个原型附加一个链</p>
+
+<pre class="brush: js">function Mammal() {
+ this.isMammal = 'yes';
+}
+
+function MammalSpecies(sMammalSpecies) {
+ this.species = sMammalSpecies;
+}
+
+MammalSpecies.prototype = new Mammal();
+MammalSpecies.prototype.constructor = MammalSpecies;
+
+var oCat = new MammalSpecies('Felis');
+
+console.log(oCat.isMammal);
+// 'yes'
+
+function Animal() {
+ this.breathing = 'yes';
+}
+
+Object.appendChain(oCat, new Animal());
+
+console.log(oCat.breathing);
+// 'yes'</pre>
+
+<p>例子二:将一个基本类型转化为对应的对象类型并添加到原型链上</p>
+
+<pre class="brush: js">function Symbol() {
+ this.isSymbol = 'yes';
+}
+
+var nPrime = 17;
+
+console.log(typeof nPrime); // 'number'
+
+var oPrime = Object.appendChain(nPrime, new Symbol());
+
+console.log(oPrime); // '17'
+console.log(oPrime.isSymbol); // 'yes'
+console.log(typeof oPrime); // 'object'</pre>
+
+<p>例子三:给函数类型的对象添加一个链,并添加一个新的方法到那个链上</p>
+
+<pre class="brush: js">function Person(sName) {
+ this.identity = sName;
+}
+
+var george = Object.appendChain(new Person('George'), 'console.log("Hello guys!!");');
+
+console.log(george.identity); // 'George'
+george(); // 'Hello guys!!'</pre>
+
+<h2 id="说明书">说明书</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">说明</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.setprototypeof', 'Object.setProtoypeOf')}}</td>
+ <td>
+ <table>
+ <tbody>
+ <tr>
+ <td>{{Spec2('ES6')}}</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">
+<p>本页面上的兼容性表是由结构化数据生成的。如果你想贡献数据,请查看<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> ,并向我们发送拉取请求。</p>
+</div>
+
+
+
+<p>{{Compat("javascript.builtins.Object.setPrototypeOf")}}</p>
+
+<div id="compat-desktop"></div>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Reflect.setPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.prototype.isPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.getPrototypeOf()")}}</li>
+ <li>{{jsxref("Object.prototype.__proto__")}} </li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/tolocalestring/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/tolocalestring/index.html
new file mode 100644
index 0000000000..611bfc560f
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/tolocalestring/index.html
@@ -0,0 +1,80 @@
+---
+title: Object.prototype.toLocaleString()
+slug: Web/JavaScript/Reference/Global_Objects/Object/toLocaleString
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Prototype
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/toLocaleString
+---
+<div>{{JSRef("Global_Objects", "Object")}}</div>
+
+<p><code><strong>toLocaleString()</strong></code> 方法返回一个该对象的字符串表示。此方法被用于派生对象为了特定语言环境的目的(locale-specific purposes)而重载使用。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.toLocaleString();</code>
+</pre>
+
+<h3 id="返回值">返回值</h3>
+
+<p>表示对象的字符串。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>{{jsxref("Object")}} <code>toLocaleString</code> 返回调用 {{jsxref("Object.toString", "toString()")}} 的结果。</p>
+
+<p>该函数提供给对象一个通用的<code>toLocaleString</code> 方法,即使不是全部都可以使用它。 见下面的列表。</p>
+
+<h3 id="覆盖_toLocaleString_的对象">覆盖 <code>toLocaleString</code> 的对象</h3>
+
+<ul>
+ <li>{{jsxref("Array")}}:{{jsxref("Array.prototype.toLocaleString()")}}</li>
+ <li>{{jsxref("Number")}}:{{jsxref("Number.prototype.toLocaleString()")}}</li>
+ <li>{{jsxref("Date")}}:{{jsxref("Date.prototype.toLocaleString()")}}</li>
+</ul>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES3')}}</td>
+ <td>{{Spec2('ES3')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.3', 'Object.prototype.toLocaleString')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.tolocalestring', 'Object.prototype.toLocaleString')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.tolocalestring', 'Object.prototype.toLocaleString')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.toLocaleString")}}</p>
+
+<h2 id="See_also" name="See_also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.toString()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/tosource/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/tosource/index.html
new file mode 100644
index 0000000000..a47cd4dbc2
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/tosource/index.html
@@ -0,0 +1,128 @@
+---
+title: Object.prototype.toSource()
+slug: Web/JavaScript/Reference/Global_Objects/Object/toSource
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Prototype
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/toSource
+---
+<div>
+<div>{{JSRef}} {{non-standard_header}}</div>
+</div>
+
+<p><strong><code>toSource()</code></strong>方法返回一个表示对象源代码的字符串。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><code><em>Object.toSource(); obj</em>.toSource()</code></pre>
+
+<h3 id="Parameters" name="Parameters">返回值</h3>
+
+<p>一个表示对象的源代码的字符串。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p><code>toSource()</code>方法返回以下值:</p>
+
+<ul>
+ <li>对于内置的{{jsxref("Object")}} 对象, <code>toSource</code>返回了下面的字符串,表示源码没法获取:</li>
+</ul>
+
+<pre class="brush: js">function Object() {
+ [native code]
+}</pre>
+
+<ul>
+ <li>对于{{jsxref("Object")}}的实例,<code>toSource()</code> 会返回该实例源代码的字符串表示。</li>
+</ul>
+
+<p>在调试时,你可以通过<code>toSource()</code>来查看一个对象的内容。</p>
+
+<h3 id="重写toSource()方法">重写toSource()方法</h3>
+
+<p>允许对象重写<code>toSource()</code>方法。例如:</p>
+
+<pre class="brush: js">function Person(name) {
+ this.name = name;
+}
+
+Person.prototype.toSource = function Person_toSource() {
+ return "new Person(" + uneval(this.name) + ")";
+};
+
+alert(new Person("Joe").toSource()); // ---&gt; new Person("Joe")</pre>
+
+<h3 id="Built-in_toString_methods" name="Built-in_toString_methods">内置<code>的toSource方法</code></h3>
+
+<p>每个JavaScript核心类型都有它自己的<code>toSource()</code>方法.这些对象是:</p>
+
+<ul>
+ <li>{{jsxref("Array.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("Array")}} object.</li>
+ <li>{{jsxref("Boolean.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("Boolean")}} object.</li>
+ <li>{{jsxref("Date.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("Date")}} object.</li>
+ <li>{{jsxref("Function.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("Function")}} object.</li>
+ <li>{{jsxref("Number.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("Number")}} object.</li>
+ <li>{{jsxref("RegExp.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("RegExp")}} object.</li>
+ <li>{{jsxref("SIMD.toSource()", "SIMD.%type%.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("SIMD")}} objects.</li>
+ <li>{{jsxref("String.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("String")}} object.</li>
+ <li>{{jsxref("Symbol.prototype.toSource()")}} {{non-standard_inline}} — {{jsxref("Symbol")}} object.</li>
+ <li><code>Math.toSource()</code> — Returns the String "Math".</li>
+</ul>
+
+<h3 id="循环引用限制">循环引用限制</h3>
+
+<p><span id="noHighlight_0.3266603437527873">对于包含对自身的引用的对象 (例如, 循环链表或可以遍历两种方式的树), </span><code>toSource()</code><span>不会重新创建自引用, 如火狐24。例如:</span></p>
+
+<pre class="brush: js">var obj1 = {};
+var obj2 = { a: obj1 };
+obj1.b = obj2;
+
+console.log('Cyclical: ' + (obj1.b.a == obj1));
+
+var objSource = obj1.toSource(); // returns "({b:{a:{}}})"
+
+obj1 = eval(objSource);
+
+console.log('Cyclical: ' + (obj1.b.a == obj1));</pre>
+
+<p><span id="noHighlight_0.30716570898096807">如果使用循环结构, 并且需要 </span><code>toSource()</code><span>, 则对象必须提供对 </span><code>toSource()</code><span> 的重写,  无论是对构造函数的引用还是提供匿名函数。</span></p>
+
+<h2 id="Examples" name="Examples">示例</h2>
+
+<h3 id="Example:_Using_toSource" name="Example:_Using_toSource">使用<code>toSource()</code></h3>
+
+<p>下面的代码定义了一个<code>Dog</code>对象类型还创建了一个<code>Dog</code>类型的对象实例<code>theDog</code>:</p>
+
+<pre class="brush:js">function Dog(name, breed, color, sex) {
+ this.name = name;
+ this.breed = breed;
+ this.color = color;
+ this.sex = sex;
+}
+
+theDog = new Dog("Gabby", "Lab", "chocolate", "girl");</pre>
+
+<p>在<code>theDog</code>上调用<code>toSource</code>方法会显示出能定义该对象的源码:</p>
+
+<pre class="brush: js">theDog.toSource();
+// returns ({name:"Gabby", breed:"Lab", color:"chocolate", sex:"female"})</pre>
+
+<h2 id="特性">特性</h2>
+
+<p>不属于任何标准的一部分。在JavaScript1.3中实现。</p>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.toSource")}}</p>
+
+<h2 id="See_Also" name="See_Also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.toString()")}}</li>
+</ul>
+
+<p></p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/tostring/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/tostring/index.html
new file mode 100644
index 0000000000..a38a5d8913
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/tostring/index.html
@@ -0,0 +1,139 @@
+---
+title: Object.prototype.toString()
+slug: Web/JavaScript/Reference/Global_Objects/Object/toString
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Prototype
+ - 原型
+ - 对象
+ - 方法
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/toString
+---
+<p>{{JSRef}}</p>
+
+<p><code><strong>toString()</strong></code> 方法返回一个表示该对象的字符串。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-prototype-tostring.html")}}</div>
+
+
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.toString()</code></pre>
+
+<h3 id="返回值">返回值</h3>
+
+<p>一个表示该对象的字符串。</p>
+
+<h2 id="描述">描述</h2>
+
+<p>每个对象都有一个 <code>toString()</code> 方法,当该对象被表示为一个文本值时,或者一个对象以预期的字符串方式引用时自动调用。默认情况下,<code>toString()</code> 方法被每个 <code>Object</code> 对象继承。如果此方法在自定义对象中未被覆盖,<code>toString()</code> 返回 "[object <em>type</em>]",其中 <code>type</code> 是对象的类型。以下代码说明了这一点:</p>
+
+<pre class="brush: js">var o = new Object();
+o.toString(); // returns [object Object]
+</pre>
+
+<div class="note"><strong>注意:</strong>如的ECMAScript 5 和随后的 Errata 中所定义,从 JavaScript 1.8.5 开始,<code>toString()</code> 调用 {{jsxref("null")}} 返回<code>[object <em>Null</em>]</code>,{{jsxref("undefined")}} 返回 <code>[object Undefined]</code>。请参阅下面的{{anch("Using_toString()_to_detect_object_class", "使用 <code>toString()</code> 检测对象类型")}}。</div>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="覆盖默认的_toString_方法">覆盖默认的 <code>toString</code> 方法</h3>
+
+<p>可以自定义一个方法,来取代默认的 <code>toString()</code> 方法。该 <code>toString()</code> 方法不能传入参数,并且必须返回一个字符串。自定义的 <code>toString()</code><span> 方法可以是任何我们需要的值,但如果它附带有关对象的信息,它将变得非常有用。</span></p>
+
+<p>以下代码定义了 <code>Dog</code> 对象类型,并创建了一个 <code>Dog</code> 类型的 <code>theDog</code> 对象:</p>
+
+<pre class="brush: js">function Dog(name,breed,color,sex) {
+ this.name = name;
+ this.breed = breed;
+ this.color = color;
+ this.sex = sex;
+}
+
+var theDog = new Dog("Gabby", "Lab", "chocolate", "female");</pre>
+
+<p>如果当前的对象调用了 <code>toString()</code> 方法,它将会返回从 {{jsxref("Object")}}继承而来的 <code>toString()</code> 方法的返回默认值:</p>
+
+<pre class="brush: js"><code>theDog.toString(); // 返回 [object Object]</code></pre>
+
+<p>下面的代码中定义了一个叫做 <code>dogToString()</code> 的方法来覆盖默认的 <code>toString()</code> 方法。这个方法生成一个 "<code>property = value;</code>" 形式的字符串,该字符串包含了当前对象的 name、breed、color 和 sex 的值。</p>
+
+<pre class="brush: js">Dog.prototype.toString = function dogToString() {
+ var ret = "Dog " + this.name + " is a " + this.sex + " " + this.color + " " + this.breed;
+ return ret;
+}</pre>
+
+<p>也可以这样写</p>
+
+<pre class="brush: js">Dog.prototype.toString = function dogToString() {
+ return `Dog ${this.name} is a ${this.sex} ${this.color} ${this.breed}`;
+}
+</pre>
+
+<p>使用上述代码,任何时候在字符串上下文中使用 <code>theDog.toString()</code> 时,JavaScript 都会自动调用 <code>dogToString()</code> 方法(<code>dogToString()</code> 可以是一个匿名函数),并且返回以下字符串:</p>
+
+<pre class="brush: js"><code>"Dog Gabby is a female chocolate Lab"</code></pre>
+
+<h3 id="使用_toString()_检测对象类型">使用 <code>toString()</code> 检测对象类型</h3>
+
+<p>可以通过 <code>toString()</code> 来获取每个对象的类型。为了每个对象都能通过 <code>Object.prototype.toString()</code> 来检测,需要以 <code>Function.prototype.call()</code> 或者 <code>Function.prototype.apply()</code> 的形式来调用,传递要检查的对象作为第一个参数,称为 <code>thisArg</code>。</p>
+
+<pre class="brush: js">var toString = Object.prototype.toString;
+
+toString.call(new Date); // [object Date]
+toString.call(new String); // [object String]
+toString.call(Math); // [object Math]
+
+//Since JavaScript 1.8.5
+toString.call(undefined); // [object Undefined]
+toString.call(null); // [object Null]
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.0.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.2', 'Object.prototype.toString')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Call on {{jsxref("null")}} returns <code>[object <em>Null</em>]</code>, and {{jsxref("undefined")}} returns <code>[object <em>Undefined</em>]</code></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.tostring', 'Object.prototype.toString')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.tostring', 'Object.prototype.toString')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.toString")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.toSource()")}}</li>
+ <li>{{jsxref("Object.prototype.valueOf()")}}</li>
+ <li>{{jsxref("Number.prototype.toString()")}}</li>
+ <li>{{jsxref("Symbol.toPrimitive")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html
new file mode 100644
index 0000000000..bcae6ae8e7
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/unobserve/index.html
@@ -0,0 +1,133 @@
+---
+title: Object.unobserve()
+slug: Web/JavaScript/Reference/Global_Objects/Object/unobserve
+translation_of: Archive/Web/JavaScript/Object.unobserve
+---
+<div>{{JSRef}} {{non-standard_header}}</div>
+
+<p><strong>Object.unobserve()</strong> 是用来移除通过 {{jsxref("Object.observe()")}}设置的观察者的方法。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code>Object.unobserve(<var>obj</var>, <var>callback</var>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>需要停止观察的对象。</dd>
+ <dt><code>callback</code></dt>
+ <dd>通过 observer 给 <strong>obj </strong>对象设置的回调函数.</dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p><code>Object.unobserve()</code> 用来在 {{jsxref("Object.observe()")}} 被调用以后,从对象上移除一个观察者。</p>
+
+<p>这个回调函数必须是一个函数的引用,而不能是一个匿名函数。因为这个引用将被用来移除之前设置的观察者方法。 给 <strong>Object.unobserve() </strong>传入匿名函数作为回调是不起作用的, 它不能移除任何观察者方法。</p>
+
+<h2 id="例子">例子</h2>
+
+<h3 id="观察一个对象">观察一个对象</h3>
+
+<pre class="brush: js">var obj = {
+  foo: 0,
+  bar: 1
+};
+
+var observer = function(changes) {
+  console.log(changes);
+}
+
+Object.observe(obj, observer);
+​
+obj.newProperty = 2;
+// [{name: 'newProperty', object: &lt;obj&gt;, type: 'add'}]
+
+Object.unobserve(obj, observer);
+
+obj.foo = 1;
+// 回调函数不会被调用</pre>
+
+<h3 id="使用匿名函数">使用匿名函数</h3>
+
+<pre class="brush: js">var person = {
+  name : 'Ahmed',
+  age : 25
+};
+
+Object.observe(person, function (changes) {
+  console.log(changes);
+});
+
+person.age = 40;
+// [{name: 'age', object: &lt;obj&gt;, oldValue: 25, type: 'update'}]
+
+Object.unobserve(person, function (changes) {
+  console.log(changes);
+});
+
+person.age = 63;
+// [{name: 'age', object: &lt;obj&gt;, oldValue: 40, type: 'update'}]
+// 回调函数将会被调用
+</pre>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome("36")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("23")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatChrome("36")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("23")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.observe()")}} {{non-standard_inline}}</li>
+ <li>{{jsxref("Array.observe()")}} {{non-standard_inline}}</li>
+ <li>{{jsxref("Array.unobserve()")}} {{non-standard_inline}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html
new file mode 100644
index 0000000000..986154992d
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html
@@ -0,0 +1,105 @@
+---
+title: Object.prototype.unwatch()
+slug: Web/JavaScript/Reference/Global_Objects/Object/unwatch
+translation_of: Archive/Web/JavaScript/Object.unwatch
+---
+<div>{{JSRef}}</div>
+
+<div class="warning">
+<p><strong>警告 :</strong> 请尽量避免使用 unwatch() 和  {{jsxref("Object.prototype.watch", "watch()")}} . 这两个方法仅在 Gecko 中实现 , 并且他们过去主要作调试用. 另外, 使用 watchpoints 对性能有一系列的副面影响 ,特别是当使用全局对象,如 <code>window</code>. 你应该使用  <a href="/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">setters and getters</a> 或 proxies 来替代. 查阅 {{anch("Browser compatibility")}} 以获取更多信息.</p>
+</div>
+
+<p><code><strong>unwatch()</strong></code> 删除一个 {{jsxref("Object.prototype.watch", "watch()")}} 设置的 watchpoint.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code><var>obj</var>.unwatch(<var>prop</var>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>prop</code></dt>
+ <dd>想要停止监视的对象的属性名</dd>
+</dl>
+
+<h2 id="描述">描述</h2>
+
+<p>JavaScript调试器具有类似的功能,以及其他调试选项。有关调试器的信息  <a href="/en-US/docs/Venkman">Venkman</a>.</p>
+
+<p>默认地, 这个方法 被每一个 {{jsxref("Object")}} 的子类继承 </p>
+
+<div class="note">
+<p><strong>Note:</strong> The reason for <code>unwatch()</code> to take the property name <em>prop</em> as its only parameter is due to the "single handler allowing" behavior of the {{jsxref("Object.watch", "watch()")}} method.</p>
+</div>
+
+<h2 id="例子">例子</h2>
+
+<p>See {{jsxref("Object.watch", "watch()")}}.</p>
+
+<h2 id="说明">说明</h2>
+
+<p>Not part of any specifications. Implemented in JavaScript 1.2.</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="Compatibility_notes">Compatibility notes</h2>
+
+<ul>
+ <li>从 Firefox 23 ({{bug(903332)}}) 开始, 在 {{domxref("Document")}} 对象上调用 <code>unwatch()</code> 抛出 {{jsxref("TypeError")}} . This regression has been fixed with Firefox 27.</li>
+</ul>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.watch()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html
new file mode 100644
index 0000000000..4601b3c4c7
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html
@@ -0,0 +1,208 @@
+---
+title: Object.prototype.valueOf()
+slug: Web/JavaScript/Reference/Global_Objects/Object/valueOf
+tags:
+ - JavaScript
+ - Method
+ - Object
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/valueOf
+---
+<div style="margin: 0px; padding: 0px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);">{{JSRef}}</div>
+
+<p><code><strong>valueOf()</strong></code> 方法返回指定对象的原始值。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre>object.valueOf()</pre>
+
+<h3 id="返回值">返回值</h3>
+
+<p>返回值为该对象的原始值。</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>JavaScript调用<code>valueOf</code>方法将对象转换为原始值。你很少需要自己调用<code>valueOf</code>方法;当遇到要预期的原始值的对象时,JavaScript会自动调用它。</p>
+
+<p>默认情况下,<code>valueOf</code>方法由{{jsxref("Object")}}后面的每个对象继承。 每个内置的核心对象都会覆盖此方法以返回适当的值。如果对象没有原始值,则<code>valueOf</code>将返回对象本身。</p>
+
+<p>JavaScript的许多内置对象都重写了该函数,以实现更适合自身的功能需要。因此,不同类型对象的valueOf()方法的返回值和返回值类型均可能不同。</p>
+
+<table class="standard-table">
+ <caption>不同类型对象的valueOf()方法的返回值</caption>
+ <thead>
+ <tr>
+ <th scope="col"><strong>对象</strong></th>
+ <th scope="col"><strong>返回值</strong></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Array</td>
+ <td>返回数组对象本身。</td>
+ </tr>
+ <tr>
+ <td>Boolean</td>
+ <td>布尔值。</td>
+ </tr>
+ <tr>
+ <td>Date</td>
+ <td>存储的时间是从 1970 年 1 月 1 日午夜开始计的毫秒数 UTC。</td>
+ </tr>
+ <tr>
+ <td>Function</td>
+ <td>函数本身。</td>
+ </tr>
+ <tr>
+ <td>Number</td>
+ <td>数字值。</td>
+ </tr>
+ <tr>
+ <td>Object</td>
+ <td>对象本身。这是默认情况。</td>
+ </tr>
+ <tr>
+ <td>String</td>
+ <td>字符串值。</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td>Math 和 Error 对象没有 valueOf 方法。</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>你可以在自己的代码中使用<code>valueOf</code>将内置对象转换为原始值。 创建自定义对象时,可以覆盖<code>Object.prototype.valueOf()</code>来调用自定义方法,而不是默认{{jsxref("Object")}}方法。</p>
+
+<h3 id="覆盖自定义对象的_valueOf方法">覆盖自定义对象的 <code>valueOf</code>方法</h3>
+
+<p>你可以创建一个取代 <code>valueOf</code>方法的函数,你的方法必须不能传入参数。</p>
+
+<p>假设你有个对象叫 <code>MyNumberType</code>而你想为它创建一个<code>valueOf</code>方法。下面的代码为<code>valueOf</code>方法赋予了一个自定义函数:</p>
+
+<pre class="brush: js">MyNumberType.prototype.valueOf = function() { return customPrimitiveValue; };</pre>
+
+<div class="line-number" style="margin: 1em 0px 0px; border: 0px; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div>
+
+<p>有了这样的一个方法,下一次每当<code>MyNumberType</code>要被转换为原始类型值时,JavaScript 在此之前会自动调用自定义的<code>valueOf</code>方法。</p>
+
+<p><code>valueOf</code>方法一般都会被 JavaScript 自动调用,但你也可以像下面代码那样自己调用:</p>
+
+<pre class="brush: js">myNumberType.valueOf()</pre>
+
+<div class="note">
+<p dir="ltr"><strong style="border: 0px; margin: 0px; padding: 0px;">注意:</strong>字符串上下文中的对象通过 {{jsxref("Object.toString", "toString()")}}方法转换,这与使用<code>valueOf</code>转换为原始字符串的{{jsxref("String")}}对象不同。所有对象都能转换成一个“<code>[object <em>类型</em>]</code>”这种格式的字符串。但是很多对象不能转换为数字,布尔或函数。</p>
+</div>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="使用_valueOf">使用 <code>valueOf</code></h3>
+
+<pre class="brush: js">// Array:返回数组对象本身
+var array = ["ABC", true, 12, -5];
+console.log(array.valueOf() === array); // true
+
+// Date:当前时间距1970年1月1日午夜的毫秒数
+var date = new Date(2013, 7, 18, 23, 11, 59, 230);
+console.log(date.valueOf()); // 1376838719230
+
+// Number:返回数字值
+var num = 15.26540;
+console.log(num.valueOf()); // 15.2654
+
+// 布尔:返回布尔值true或false
+var bool = true;
+console.log(bool.valueOf() === bool); // true
+
+// new一个Boolean对象
+var newBool = new Boolean(true);
+// valueOf()返回的是true,两者的值相等
+console.log(newBool.valueOf() == newBool); // true
+// 但是不全等,两者类型不相等,前者是boolean类型,后者是object类型
+console.log(newBool.valueOf() === newBool); // false
+
+// Function:返回函数本身
+function foo(){}
+console.log( foo.valueOf() === foo ); // true
+var foo2 = new Function("x", "y", "return x + y;");
+console.log( foo2.valueOf() );
+/*
+ƒ anonymous(x,y
+) {
+return x + y;
+}
+*/
+
+// Object:返回对象本身
+var obj = {name: "张三", age: 18};
+console.log( obj.valueOf() === obj ); // true
+
+// String:返回字符串值
+var str = "http://www.xyz.com";
+console.log( str.valueOf() === str ); // true
+
+// new一个字符串对象
+var str2 = new String("http://www.xyz.com");
+// 两者的值相等,但不全等,因为类型不同,前者为string类型,后者为object类型
+console.log( str2.valueOf() === str2 ); // false</pre>
+
+<p> </p>
+
+<h3 id="改写_.prototype.valueof">改写 .prototype.valueof</h3>
+
+<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">MyNumberType</span><span class="punctuation token">(</span>n<span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ <span class="keyword token">this</span><span class="punctuation token">.</span>number <span class="operator token">=</span> n<span class="punctuation token">;</span>
+<span class="punctuation token">}</span>
+
+MyNumberType<span class="punctuation token">.</span>prototype<span class="punctuation token">.</span>valueOf <span class="operator token">=</span> <span class="keyword token">function</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ <span class="keyword token">return</span> <span class="keyword token">this</span><span class="punctuation token">.</span>number<span class="punctuation token">;</span>
+<span class="punctuation token">}</span><span class="punctuation token">;</span>
+
+<span class="keyword token">var</span> myObj <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">MyNumberType</span><span class="punctuation token">(</span><span class="number token">4</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+myObj <span class="operator token">+</span> <span class="number token">3</span><span class="punctuation token">;</span> <span class="comment token">// 7</span></code></pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.1.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.4', 'Object.prototype.valueOf')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.valueof', 'Object.prototype.valueOf')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.valueof', 'Object.prototype.valueOf')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">
+<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+</div>
+
+<p>{{Compat("javascript.builtins.Object.valueOf")}}</p>
+
+<h2 id="参考">参考</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.toString()")}}</li>
+ <li>{{jsxref("parseInt", "parseInt()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/values/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/values/index.html
new file mode 100644
index 0000000000..42d9cced00
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/values/index.html
@@ -0,0 +1,113 @@
+---
+title: Object.values()
+slug: Web/JavaScript/Reference/Global_Objects/Object/values
+tags:
+ - JavaScript
+ - Method
+ - Object
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/values
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>Object.values()</strong></code>方法返回一个给定对象自身的所有可枚举属性值的数组,值的顺序与使用{{jsxref("Statements/for...in", "for...in")}}循环的顺序相同 ( 区别在于 for-in 循环枚举原型链中的属性 )。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><code>Object.values(<var>obj</var>)</code></pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>obj</code></dt>
+ <dd>被返回可枚举属性值的对象。</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>一个包含对象自身的所有可枚举属性值的数组。</p>
+
+<h2 id="描述">描述</h2>
+
+<p><code>Object.values()</code>返回一个数组,其元素是在对象上找到的可枚举属性值。属性的顺序与通过手动循环对象的属性值所给出的顺序相同。</p>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js">var obj = { foo: 'bar', baz: 42 };
+console.log(Object.values(obj)); // ['bar', 42]
+
+// array like object
+var obj = { 0: 'a', 1: 'b', 2: 'c' };
+console.log(Object.values(obj)); // ['a', 'b', 'c']
+
+// array like object with random key ordering
+// when we use numeric keys, the value returned in a numerical order according to the keys
+var an_obj = { 100: 'a', 2: 'b', 7: 'c' };
+console.log(Object.values(an_obj)); // ['b', 'c', 'a']
+
+// getFoo is property which isn't enumerable
+var my_obj = Object.create({}, { getFoo: { value: function() { return this.foo; } } });
+my_obj.foo = 'bar';
+console.log(Object.values(my_obj)); // ['bar']
+
+// non-object argument will be coerced to an object
+console.log(Object.values('foo')); // ['f', 'o', 'o']</pre>
+
+<p class="brush: js"> </p>
+
+<h2 id="Polyfill">Polyfill </h2>
+
+<p><code><font face="Open Sans, arial, x-locale-body, sans-serif"><span style="background-color: #ffffff;">如果要 </span></font>Object.values</code>兼容不支持它的旧环境,可在<font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: #eeeeee;"> </span></font><a href="https://github.com/tc39/proposal-object-values-entries">tc39/proposal-object-values-entries</a> 或 <a href="https://github.com/es-shims/Object.values">es-shims/Object.values</a> 中找到 Polyfill 。</p>
+
+<p>根据<strong>Object.keys()</strong>的Polyfill仿写一个:</p>
+
+<pre class="brush: js">if (!Object.values) Object.values = function(obj) {
+ if (obj !== Object(obj))
+ throw new TypeError('Object.values called on a non-object');
+ var val=[],key;
+ for (key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj,key)) {
+ val.push(obj[key]);
+ }
+ }
+ return val;
+}</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.values', 'Object.values')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES8', '#sec-object.values', 'Object.values')}}</td>
+ <td>{{Spec2('ES8')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
+
+<p>{{Compat("javascript.builtins.Object.values")}}</p>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties">Enumerability and ownership of properties</a></li>
+ <li>{{jsxref("Object.keys()")}}</li>
+ <li>{{jsxref("Object.entries()")}} {{experimental_inline}}</li>
+ <li>{{jsxref("Object.prototype.propertyIsEnumerable()")}}</li>
+ <li>{{jsxref("Object.create()")}}</li>
+ <li>{{jsxref("Object.getOwnPropertyNames()")}}</li>
+</ul>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html
new file mode 100644
index 0000000000..540967eee3
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/watch/index.html
@@ -0,0 +1,201 @@
+---
+title: Object.prototype.watch()
+slug: Web/JavaScript/Reference/Global_Objects/Object/watch
+tags:
+ - Debugging
+ - Deprecated
+ - JavaScript
+ - Method
+ - Object
+ - Obsolete
+ - Prototype
+translation_of: Archive/Web/JavaScript/Object.watch
+---
+<p>{{JSRef}}</p>
+
+<div class="warning">
+<p><strong>警告:</strong> 通常来讲,你应该尽量避免使用 <code>watch()</code>和  {{jsxref("Object.prototype.unwatch", "unwatch()")}} 这两个方法。因为只有 Gecko 实现了这两个方法,并且它们主要是为了在调试方便。另外,使用 watchpoint 对性能有严重的负面影响,在全局对象(如 window)上使用时尤其如此。你可以使用 <a href="/zh-cn/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters" title="https://developer.mozilla.org/zh-cn/Core_JavaScript_1.5_Guide/Working_with_Objects#Defining_getters_and_setters">setters and getters</a> 或者 proxy 代替。参见 {{ anch("Compatibility") }} 了解详情。</p>
+</div>
+
+<p><code><strong>watch() </strong></code>方法会监视属性是否被赋值并在赋值时运行相关函数。</p>
+
+<h2 id="Summary" name="Summary">语法</h2>
+
+<pre class="syntaxbox"><em>obj</em>.watch(<em>prop</em>, <em>handler</em>)</pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<dl>
+ <dt><code>prop</code></dt>
+ <dd>想要监视值是否发生变化的指定对象的某个属性的属性名称</dd>
+</dl>
+
+<dl>
+ <dt><code>handler</code></dt>
+ <dd>当指定的属性发生变化时执行的回调函数</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>{{jsxref("undefined")}}.</p>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p>监视对指定对象的名为 <code>prop</code> 属性的赋值操作,只要 <code>prop</code> 属性被赋值,便调用 <code>handler(prop, oldval, newval)</code> 回调函数,并将函数返回值保存到该属性。 通过返回修改的新值(或者返回旧值),一个监视点可以过滤(或使之为 null )赋值。</p>
+
+<p>如果你删除某个设置监视点的属性,该监视点并不会消失。如果你之后重新创建这个属性,监视点仍然有效。</p>
+
+<p>要移除某个监视点,使用 <code><a href="/zh-cn/JavaScript/Reference/Global_Objects/Object/unwatch" title="zh-cn/JavaScript/Reference/Global_Objects/Object/unwatch">unwatch()</a></code> 方法。默认所有 <code>Object</code> 的后代都将继承 <code>watch</code> 方法。</p>
+
+<p>JavaScript 调试器有与之相似的机制以及其它调试选项。需要更多有关调试器的信息,请查阅 <a href="/zh-cn/Venkman" title="zh-cn/Venkman">Venkman</a>。</p>
+
+<p>对于 Firefox,<code>handler</code> 只会被脚本内的赋值操作激活,并不包括本地代码。举个例子,如果用户点击一个指向当前文档内的某个锚点, <code>window.watch('location', myHandler)</code> 不会回调 <code>myHandler</code> ,但 <code>window.location += '#myAnchor'</code> 将触发回调  <code>myHandler</code>。</p>
+
+<div class="note"><strong>注意:</strong> 对一个对象的指定属性调用 <code>watch()</code>  将覆盖先前关联的 handler。</div>
+
+<h2 id="Examples" name="Examples">例子</h2>
+
+<h3 id="Example_Using_watch_and_unwatch" name="Example:_Using_watch_and_unwatch">使用 <code>watch</code> 和 <code>unwatch</code></h3>
+
+<pre class="brush: js">var o = {p:1};
+o.watch("p",
+ function (id, oldval, newval) {
+ console.log("o." + id + "由" + oldval + " 变为 " + newval);
+ return newval;
+ });
+
+o.p = 2;
+o.p = 3;
+delete o.p;
+o.p = 4;
+
+o.unwatch('p');
+o.p = 5;
+</pre>
+
+<p>上面的代码显示结果如下:</p>
+
+<pre class="eval">o.p 由 1 变为 2
+o.p 由 2 变为 3
+o.p 由 undefined 变为 4
+</pre>
+
+<h3 id="Example_Using_watch_to_validate_an_object.27s_properties" name="Example:_Using_watch_to_validate_an_object.27s_properties">使用 <code>watch</code> 来验证一个对象的属性</h3>
+
+<p>你可以使用 <code>watch</code> 来检测一个对象的属性赋值是否是合法的.下例演示了如何确保每个人始终具有一个合法的名字和0 到 200之间的年龄.</p>
+
+<pre class="brush: js">Person = function(name,age) {
+ this.watch("age", Person.prototype._isValidAssignment);
+ this.watch("name", Person.prototype._isValidAssignment);
+ this.name = name;
+ this.age = age;
+}
+
+Person.prototype.toString = function() {
+ return this.name + ", " + this.age;
+};
+
+Person.prototype._isValidAssignment = function(id, oldval, newval) {
+ if (id === "name" &amp;&amp; (!newval || newval.length &gt; 30)) {
+ throw new RangeError("不合法的名字 " + this);
+ }
+ if (id === "age" &amp;&amp; (newval &lt; 0 || newval &gt; 200)) {
+ throw new RangeError("不合法的年龄 " + this);
+ }
+ return newval;
+}
+
+will = new Person("Will", 29);
+print(will); // Will, 29
+
+try {
+ will.name = "";
+} catch (e) {
+ //print(e);
+ console.log(e);
+}
+
+try {
+ will.age = -4;
+} catch (e) {
+ console.log(e);
+}
+</pre>
+
+<p>上面的代码显示结果如下:</p>
+
+<pre class="eval">Will, 29
+RangeError: 不合法的名字 Will, 29
+RangeError: 不合法的年龄 Will, 29
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<p>不是任何规范的一部分。从 JavaScript 1.2 开始实现。</p>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="兼容性提示">兼容性提示</h2>
+
+<ul>
+ <li>此 <a href="https://gist.github.com/384583">Polyfill</a> 为所有 ES5 兼容浏览器提供 <code>watch</code> 支持。</li>
+ <li>使用 {{jsxref("Proxy")}} 允许你更加深度地调整属性服务机制</li>
+ <li>从 Firefox 23 开始,在 {{domxref("Document")}} 对象上调用 <code>watch()</code> 将抛出 {{jsxref("TypeError")}} 错误。这个回归问题已经在 Firefox 27 修复。</li>
+</ul>
+
+<h2 id="See_Also" name="See_Also">相关链接</h2>
+
+<ul>
+ <li>{{jsxref("Object.unwatch()")}}</li>
+ <li>{{jsxref("Object.observe()")}} {{obsolete_inline}}</li>
+</ul>