ES6 introduced a new way of working with functions and iterators in the form of Generators (or generator functions). A generator is function that can stop midway and then continue from where it stopped. In short, a generator appears to be a function but it behaves like an iterator.
Full article