DEV Community

Discussion on: Understanding Generators in ES6 Javascript

Collapse
 
fpuffer profile image
Frank Puffer

Looking forward to your next post. What you have shown so far can be achieved much more easily with a simple array but I am sure there are better use cases for generators. I guess it gets more interesting when you don't know in advance how many values need to be generated.

Collapse
 
tuanphungcz profile image
Tuan Phung ⚡️

I finally got some time, so I wrote down one example for the usage of generators, hope that you'll enjoy reading it 👉dev.to/phung_cz/canceling-promises...