Promise is a proxy for a value not knowing when its creation time. It provide 2 Methods then
and catch
, which return promise so they can be chained.
Appends fullfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.