Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptgenerator return throw protocolSingle-choice MCQ

Inside outer(), a yield* delegates to inner(), and inner() ends with a return statement. What is the value bound to `r`?

function* inner() { yield 'a'; return 'RET'; } function* outer() { const r = yield* inner(); yield r; } const it = outer(); it.next(); // { value: 'a', done: false } it.next(); // { value: ?, done: false }