Part 1: raw callbacks

Callback functions (“callbacks” for short) are the core low-level primitive for asynchrony in JavaScript. This part explores them in-depth, taking extra care to highlight common pitfalls, best and bad practices so you better appreciate later the solutions brought by promises and async/await.

You can download all code samples for this part if you’d like to experiment on your own machine, along with all the videos for this part if you absolutely need to view them offline:
async-js-part-1-vanilla-callbacks-code.zip 11.67 KB

async-js-part-1-vanilla-callbacks-videos.zip 468.9 MB
Part 1: raw callbacks
Intro, definition & optional asynchrony
5 mins
Examples of async APIs
2 mins
Pitfalls: Run-To-Completion & execution order
3 mins
Pitfalls: Exception propagation
2 mins
Pitfalls: Zalgo
5 mins
Pitfalls: late registration, missed calls and extraneous calls
3 mins
Sequencing callbacks
10 mins
Node-style callbacks
4 mins
Pitfalls inherent to Node-style callbacks
4 mins
Limitations inherent to callbacks
3 mins
Grouping and racing callbacks
5 mins
Debugging async code
11 mins
Outro part 1
1 min