Newly added in ES7, generators are functions that can be paused while data is awaited.
When you instantiate a generator function, it returns an object containing a next() method and a finished property. Every time you call next(), the generator will yield the next value in the sequence. If and when you reach the end of the sequence, the finished property will equal true. Generators are effectively factories for iterators, which are functions that are able to access items from a collection one at a time, while keeping track of their internal position.
For more on generators, visit http://mdn.io/Iterators_and_Generators.
Let's play with them a little by rendering an unsolved mathematical problem, called the Ulam spiral. Discovered ...