September 2024
Beginner to intermediate
985 pages
35h 37m
English
With ES2015, a feature has been added to the ECMAScript standard that allows functions to be paused or interrupted at certain points and resumed at a later time. The constructs that are used here are called generators. They are generated via generator functions.
Generator functions are defined using the function keyword, immediately followed by an asterisk (function*). When a generator function is called, it returns a generator that can be used to control the execution of the code defined in the generator function.
A generator is interrupted using the newly introduced yield operator. The yield operator, like return, returns a value and causes a step out from the generator. ...
Read now
Unlock full access