> For the complete documentation index, see [llms.txt](https://shoppinpal.gitbook.io/docs-shoppinpal-com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoppinpal.gitbook.io/docs-shoppinpal-com/7.-promises/what-are-promises.md).

# What are Promises

The absolute reference: <https://www.promisejs.org/>

![](https://299721776-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBPk9Ii0WH-txgubgY2%2F-LBPkEsjuKBT4BqsRiAN%2F-LBPkM5TbEmg_eeWh057%2FScreen%20Shot%202017-02-02%20at%204.15.35%20AM.png?generation=1525162283681045\&alt=media)

1. Promises are nothing but a chain of success/fail events
2. We can use promises in nested callback which are dependent to each other this is termed as a callback hell It is hard to understand and creates lot of confusion.
3. Promises can handle global errors.
4. Promises can be chained (you don't have this encapsulation like callbacks)
5. Promise is an interface class that helps you to control if the call to a function - that may be executed asynchronously - has finished successfully or with an error. It is very similar to have a try-catch-finally block for async calls.
