Introducing the concept of Promises
Promises, also known as Futures, are described by Computer Science as specialized objects that are used for synchronization of asynchronous, concurrent, or parallel procedures. They are also used as proxies to propagate the result of a task when its generation completes. This way, a Promise object is like a contract where an operation will eventually complete its execution, and anyone having a reference to this contract can declare their interest to be notified about the result.
Since they were introduced to JavaScript developers, as part of several libraries, they revolutionized the way we use asynchronous functions and compose them in implementation with complex synchronization schemes. This way, web developers can create more flexible, scalable, and readable implementations, making method invocations with callbacks look like a primitive pattern and effectively eliminating the Callback Hell situations.
One of the key concepts of Promises is that asynchronous...