December 2014
Beginner
308 pages
7h 10m
English
CHAPTER 10
![]()
Simplifying Callbacks
The evented/asynchronous nature of Node.js means that it is possible to end up with deeply nested callbacks. There are various strategies in JavaScript that help reduce the callback nesting. In this chapter, we will explore these patterns. These help maintain readability, but more importantly these strategies will help decrease the likelihood of bugs creeping up on you. I promise.
The Callback Hell
Note that as we explore this section, it might seem like the situation is dire. Don’t worry. When we look at promises in the next section, you will find the pot of gold at the end of the rainbow.
An obvious issue with ...