24/11/2023 7:44 am
Topic starter
Notifications
Clear all
How do you handle promises using `.then()` and `.catch()`?
0
How do you handle promises using `.then()` and `.catch()`?
Answer
Add a comment
Add a comment
1 Answer
0
01/12/2023 7:14 am
- then : when a promise is successful, you can then use the resolved data.
- catch : when a promise fails, you catch the error, and do something with the error information.
- finally : when a promise settles (fails or passes), you can finally do something.
Add a comment
Add a comment
Forum Information
- 14 Forums
- 1,835 Topics
- 5,051 Posts
- 1 Online
- 1,078 Members
Our newest member: Richardnop
Latest Post: loli
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed