What is Generator Function?

Generator functions are a new feature in ES6 that allow a function to generate many values over time by returning an object which can be iterated over to pull values from the function one value at a time.
A generator function returns an iterable object when it is invoked. It is written using the new * syntax as well as the new yield keyword introduced in ES6.