How do you handle p…
 
Notifications
Clear all

How do you handle promises using `.then()` and `.catch()`?

1 Posts
2 Users
0 Likes
170 Views
0
Topic starter

How do you handle promises using `.then()` and `.catch()`?

1 Answer
0
  1. then : when a promise is successful, you can then use the resolved data.
  2. catch : when a promise fails, you catch the error, and do something with the error information.
  3. finally : when a promise settles (fails or passes), you can finally do something.
Share: