We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

The legacy generator function expression was a SpiderMonkey-specific feature, which is removed in Firefox 58+. For future-facing usages, consider using the function* expression.

The function keyword can be used to define a legacy generator function inside an expression. To make the function a legacy generator, the function body should contain at least one yield expression.


function [name]([param1[, param2[, ..., paramN]]]) {


The function name. Can be omitted, in which case the function is anonymous. The name is only local to the function body.
The name of an argument to be passed to the function. A function can have up to 255 arguments.
The statements which comprise the body of the function. This should contain at least one yield expression.


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

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No No2 — 58 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic support No No No4 — 58 No No No

See also

Schlagwörter des Dokuments und Mitwirkende

 Mitwirkende an dieser Seite: fscholz, mfluehr, arai
 Zuletzt aktualisiert von: fscholz,