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

Calling it.throw(err) on a generator that has NEVER been started (no next() yet) and whose body wraps everything in try/catch behaves how?

function* g() { try { yield 1; } catch (e) { console.log('inside catch'); } } const it = g(); it.throw(new Error('boom'));