Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Callback Hell

  • The callback pattern is the default pattern for managing the outcome of an asynchronous method
  • Nested callbacks become unmanageable and unreadable
  • Nested callbacks are often termed as “Callback hell”

Example

firstFunction(args, function () {
  secondFunction(args, function () {
    thirdFunction(args, function () {
      // And so on…
    })
  })
})