es6-promises Flashcards
1
Q
What are the three states a Promise can be in?
A
- Pending: initial state, neither fulfilled nor rejected
- Fulfilled: meaning that the operation was completed successfully
- Rejected: meaning that the operation failed
2
Q
How do you handle the fulfillment of a Promise?
A
then() method
3
Q
How do you handle the rejection of a Promise?
A
catch() method or then() method