April 2018
Beginner
226 pages
4h 47m
English
If you hate the callback style in JavaScript or prefer blocking or pausing an asynchronous execution and resuming it when data is received, you will love what the new ECMAScript has introduced in JavaScript: generators.
To put it simply, generators are iterable functions that:
These are the specifications of a generator. To clarify the definition, let's implement the concept in our AJAX example.
The asynchronous line in our code is $.getJSON('http://localhost:3300/') ...
Read now
Unlock full access