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.
You have an error in your return example: the value you
return
will be returned by the iterator'snext
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 ;)