DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Discussion on: Understanding Generators in ES6 Javascript

Collapse
danielescoz profile image
Daniel Escoz

You have an error in your return example: the value you return will be returned by the iterator's next call as a single {value: "Ultron", done: true}, not in two distinct steps.

Also, undefined should be between quotes, it's not a string but a specific value.

Collapse
tuanphungcz profile image
Tuan Phung ⚑️ Author

Nice catch, just fixed that, thanks ;)