JavaScript Promises: An introduction
Promises simplify deferred and asynchronous computations. A promise represents an operation that hasn’t completed yet.
A promise can be:
fulfilled – The action relating to the promise succeeded
rejected – The action relating to the promise failed
pending – Hasn’t fulfilled or rejected yet
settled – Has fulfilled or rejected