JavaScript: Generator Functions
There is such a thing as generator functions in JavaScript and they let you define functions that return Generator objects. The syntax for defining a generator function is nearly the same as for defining a regular function.
function* makeIterator() {...
andykoch.hashnode.dev2 min read