From c40612041809fe289aba58aefa170bbe784aba1f Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove name attribute for zh-CN --- .../zh-cn/web/javascript/reference/operators/yield/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/operators/yield') diff --git a/files/zh-cn/web/javascript/reference/operators/yield/index.html b/files/zh-cn/web/javascript/reference/operators/yield/index.html index a0a3b92756..f34061ded0 100644 --- a/files/zh-cn/web/javascript/reference/operators/yield/index.html +++ b/files/zh-cn/web/javascript/reference/operators/yield/index.html @@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Operators/yield

yield 关键字用来暂停和恢复一个生成器函数(({{jsxref("Statements/function*", "function*")}} 或遗留的生成器函数)。

-

语法

+

语法

[rv] = yield [expression];
@@ -45,7 +45,7 @@ translation_of: Web/JavaScript/Reference/Operators/yield

在生成器的代码路径中的yield运算符,以及通过将其传递给{{jsxref("Generator.prototype.next()")}}指定新的起始值的能力之间,生成器提供了强大的控制力。

-

示例

+

示例

以下代码是一个生成器函数的声明。

@@ -64,7 +64,7 @@ console.log(appleStore.next()); // { value: 7, done: false } console.log(appleStore.next()); // { value: 5, done: false } console.log(appleStore.next()); // { value: undefined, done: true } -

规范

+

规范

@@ -88,11 +88,11 @@ console.log(appleStore.next()); // { value: undefined, done: true }
-

浏览器兼容性

+

浏览器兼容性

{{Compat("javascript.operators.yield")}}

-

相关链接

+

相关链接