Using promises is Javascript, when data resolved you can access the resolved values as an argument within a .then callback function. Imagine we are writing code where we need to make two separate API requests, and wait for both to resolve.
If request 2 depends on data from request 1, our code will look something like this:
!carbon (4).png
This can get messy very quickly, if the number of promises we need to resolve increases, so does the number of .then calls, resulting in an ugly chain of .then calls, also known as callback hell.
To escape callback hell, you can use Async/Await syntax in Javascript to ensure that promise data can be resolved before using it like this:
!carbon (5).png