aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/generatorfunction
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/generatorfunction')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/generatorfunction/index.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/generatorfunction/index.html b/files/zh-cn/web/javascript/reference/global_objects/generatorfunction/index.html
index afa1c2ac8c..379b31a804 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/generatorfunction/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/generatorfunction/index.html
@@ -19,11 +19,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/GeneratorFunction
<pre class="brush: js">Object.getPrototypeOf(function*(){}).constructor
</pre>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code>new GeneratorFunction ([<var>arg1</var>[, <var>arg2</var>[, ...<var>argN</var>]],] <var>functionBody</var>)</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>arg1, arg2, ... arg<em>N</em></code></dt>
@@ -32,7 +32,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/GeneratorFunction
<dd>一个包含多条表示JavaScript函数体语句的字符串。</dd>
</dl>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>当创建函数时,将使用<code>GeneratorFunction</code>构造函数创建的{{jsxref("Statements/function*", "生成器函数")}}对象进行解析。这比使用{{jsxref("Statements/function*", "function* 表达式")}} 声明生成器函数效率更低,并且在代码中调用它,因为这些函数与其余的代码一起被解析。</p>
@@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/GeneratorFunction
<p>将<code>GeneratorFunction</code>构造函数调用为函数(不使用<code>new</code>运算符)与将其作为构造函数调用的效果相同。</p>
-<h2 id="Properties" name="Properties">属性</h2>
+<h2 id="Properties">属性</h2>
<dl>
<dt><code><strong>GeneratorFunction.length</strong></code></dt>
@@ -59,11 +59,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/GeneratorFunction
<div>{{page('/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction/prototype', 'Properties')}}</div>
-<h2 id="GeneratorFunction_instances" name="GeneratorFunction_instances"><code>GeneratorFunction</code> 实例</h2>
+<h2 id="GeneratorFunction_instances"><code>GeneratorFunction</code> 实例</h2>
<p><code>GeneratorFunction</code>实例从{{jsxref("GeneratorFunction.prototype")}}继承方法和属性。与所有构造函数一样,你可以更改构造函数的原型对象以对所有<code>GeneratorFunction</code>实例进行更改。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<h3 id="从GeneratorFunction构造函数创建一个生成器函数">从<code>GeneratorFunction</code>构造函数创建一个生成器函数</h3>
@@ -99,7 +99,7 @@ console.log(iterator.next().value); // 20
<p>{{Compat("javascript.builtins.GeneratorFunction")}}</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("Statements/function*", "function* function")}}</li>