Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Legacy generator function原始函数生成器[函数普通定义]

这篇翻译不完整。请帮忙从英语翻译这篇文章

The legacy generator function is a SpiderMonkey-specific feature, and will be removed at some point. For future-facing usages, consider using function*.

The legacy generator function statement declares legacy generator functions with the specified parameters.

You can also define functions using the Function constructor with functionBody and at least one yield expression, and a legacy generator function expression.

Syntax语法

function name([param,[, param,[..., param]]]) {
   [statements]
}
name
函数名。
param
传入函数的参数名,一个函数最多有255个参数。
statements
The statements which comprise the body of the function. This should contain at least one yield expression.

Description描述

An overview of the usage is available on the Iterators and Generators page.

Browser compatibility浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 未实现 (Yes) 未实现 未实现 未实现
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 未实现 未实现 (Yes) 未实现 未实现 未实现

See also参考

文档标签和贡献者

 此页面的贡献者: ruiM92, bluelifeleer
 最后编辑者: ruiM92,