Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptgenerators and yieldSingle-choice MCQ

A generator has a `return 99` after its yields. What does `[...g()]` produce, and where does 99 go?

function* g() { yield 1; yield 2; return 99; } console.log([...g()]);