June 2018
Beginner
288 pages
6h 31m
English
Newer asynchronous functions in JavaScript are designed to return a promise instead of taking a callback. A promise is an object through which a function may propagate an error or result sometime in the future. At any time, a promise is in one of three states: pending, resolved, or rejected.

If an asynchronous function has not completed its task, the promise it returned will be in the pending state. Whenever the asynchronous function completes successfully, it will set the promise into the resolved state. At this time, the promise generates or emits the result passed through it—we refer to this as the promise resolves. If ...
Read now
Unlock full access