01 / 17

Explain the concept of 'callback hell' and how to mitigate it.

Callback hell (also called the "Pyramid of Doom") occurs when multiple and deeply nested callbacks are used producing difficult-to-read deeply indented, unmaintainable code.

This is a common issue when dealing with asynchronous operations. To make code more organised and readable, you can use techniques like
  1. 1

    named functions

  2. 2

    modularisation

  3. 3

    Promises

  4. 4

    async/await to