MediumConceptAdvanced JavaScript
What is a generator function and where is it useful?
What a good answer covers
A function declared with function* that can pause at yield and resume, returning an iterator. It suits lazy sequences, custom iteration and, historically, coroutine-style async flows.
PreviousWhat are web workers useful for?Next What is the difference between Object.freeze and const?