re: Understanding Generators in ES6 Javascript VIEW POST


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.


Nice catch, just fixed that, thanks ;)

code of conduct - report abuse