Promises
Generators in JavaScript - Introduction
Introduction to generators A generator function is a special kind of function that was introduced in ES2015 (ES6). In JavaScript once we start a function it has to run to its completion. However, generator functions enable us to create functions that another code can reenter multiple times. Furthermore, nothing from outside of the generation function can make it exit/pause. Generator function pauses itself when it runs into a yield expression. Once a execution reaches yield expression, generator can not continue execution on its own. Something from outside has to continueits execution.