Language concepts

yield* expression

Try the free JavaScript compiler

Delegates to an iterator, forwarding yielded values; the final completion value becomes the value of the delegation expression.

Formal Syntax & Structure

javascript syntaxjavascript
yield* iterable

Working Example

Example Snippetjavascript
function* g(){yield* [1,2];}console.log(JSON.stringify([...g()]));
JavaScript Reference