Language concepts
yield expression
Suspends a generator and makes a value available to its consumer. On resumption, the expression evaluates to the input supplied by the next call.
Formal Syntax & Structure
javascript syntaxjavascript
yield expressionWorking Example
Example Snippetjavascript
function* g(){const x=yield 1;yield x;}const i=g();i.next();console.log(i.next(8).value);