July 2019
Intermediate to advanced
416 pages
10h 6m
English
We often need to write code that behaves in an asynchronous fashion. By this, we mean that we need to start a task off and leave it running in the background while we do something else. An example of this could be when we have made a call out to a web service, which may take a while to return. For a long time, the standard way in JavaScript was to use a callback. A big problem with this approach is that the more callbacks we need, the more complex and potentially error-prone our code becomes. This is where promises come in.
A promise tells us that something will happen asynchronously; after the asynchronous operation finishes, we have the option to continue processing and work with ...
Read now
Unlock full access