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

Our volunteers haven't translated this article into Bahasa Indonesia yet. Join us and help get the job done!
You can also read the article in English (US).

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

Tag Dokumen dan Kontributor

 Kontributor untuk laman ini: fscholz, mfluehr, arai
 Terakhir diperbarui oleh: fscholz,