aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
diff options
context:
space:
mode:
authort7yang <t7yang@gmail.com>2022-01-10 08:38:07 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commitc40612041809fe289aba58aefa170bbe784aba1f (patch)
tree8ca89b071d04afcf7abd6d9a04d0765a041d9c8a /files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html
parent12a899ab8540bc84f56a0dc6491be80a48499d49 (diff)
downloadtranslated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.gz
translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.bz2
translated-content-c40612041809fe289aba58aefa170bbe784aba1f.zip
remove name attribute for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html10
1 files changed, 5 insertions, 5 deletions
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
index f412762462..09c0ff1c1a 100644
--- 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
@@ -14,11 +14,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/preventExtensions
<p>{{EmbedInteractiveExample("pages/js/object-preventextensions.html")}}</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code>Object.preventExtensions(<em>obj</em>)</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>obj</code></dt>
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/preventExtensions
<dd>已经不可扩展的对象。</dd>
</dl>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>如果一个对象可以添加新的属性,则这个对象是可扩展的。<code>Object.preventExtensions()</code>将对象标记为不再可扩展,这样它将永远不会具有它被标记为不可扩展时持有的属性之外的属性。注意,一般来说,不可扩展对象的属性可能仍然可被<em>删除</em>。尝试将新属性添加到不可扩展对象将静默失败或抛出{{jsxref("TypeError")}}(最常见的情况是{{jsxref("Functions_and_function_scope/Strict_mode", "strict mode", "", 1)}}中,但不排除其他情况)。</p>
@@ -39,7 +39,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/preventExtensions
<p>一旦将对象变为不可扩展的对象,就再也不能使其可扩展。</p>
-<h2 id="Examples" name="Examples">例子</h2>
+<h2 id="Examples">例子</h2>
<pre class="brush: js">// Object.preventExtensions将原对象变的不可扩展,并且返回原对象.
var obj = {};
@@ -117,7 +117,7 @@ Object.preventExtensions(1);
<p>{{Compat("javascript.builtins.Object.preventExtensions")}}</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("Object.isExtensible()")}}</li>