What are the pros and cons of using promises instead of callbacks?
Here are the pros of using promises over callbacks:
- Better defined and organized control flow of asynchronous logic.
- Highly reduced coupling.
- We have integrated error handling.
- Enhanced readability.
Cons of using Promises over callbacks:
- It kills the purpose of asynchronous non-blocking I/O.
- Only one object can be returned.
- We cannot return multiple arguments.
BY Best Interview Question ON 09 Feb 2021