DEV Community

loading...

Discussion on: An Introduction to JavaScript Generators

Collapse
katnel20 profile image
Katie Nelson

I really enjoyed this great post Alice.
I'm trying to think of a good use-case for a generator.

One question I have is:
Is there a way to restart the process once you iterate to the end of a generator function?

Collapse
kallaugher profile image
Alice Kallaugher Author

Thanks Katie!

To answer your question: you can't restart a generator once it's done. You would have to call the generator function again.