1.

What are the pros and cons of using promises instead of callbacks?

Answer»

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.


Discussion

No Comment Found