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

Why is the argument passed to a generator's very first `.next()` call always discarded?

function* g() { const x = yield 1; return x; } const it = g(); it.next('A'); // first resume it.next('B'); // second resume