es6-promises Flashcards
1
Q
What are the three states a Promise can be in?
A
- resolve
- reject
- pending
2
Q
How do you handle the fulfillment of a Promise?
A
With a value. A “.then()” method is called along with its associated handlers.
3
Q
How do you handle the rejection of a Promise?
A
With a reason (error). A “.then()” method is called along with it’s associated handlers. Or a “.catch()” method can be used to catch the error.