yield
yield is a JavaScript function in the Iterator category. Pauses a generator. The syntax is yield expr. A typical example: function* gen() { yield 1 }. A close sibling is Iterator.prototype.every(), which tests if all values pass a test. A close sibling is Iterator.prototype.find(), which returns the first value that passes a test. A close sibling is Iterator.prototype.some(), which checks if any value passes a test. A close sibling is Iterator.prototype.forEach(), which executes for each value. More about this category: Iterator and generator methods. Related Iterator methods: Iterator.prototype.every(), Iterator.prototype.find(), Iterator.prototype.some(), Iterator.prototype.forEach(), Iterator.prototype.reduce(), Iterator.prototype.toArray(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try yield immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.