Given the provided (very simple) generator, is it possible to return the generator back to its original state to use again?
var generator = function*() {
As per the draft version of ES6,
Once a generator enters the
"completed"state it never leaves it and its associated execution context is never resumed. Any execution state associated with generator can be discard at this point.
So, there is no way to reset it once it is completed. It also makes sense to be so. We call it a generator, for a reason :)