Answers for "javascript catch function"

5

catch javascript

//Catch is the method used when your promise has been rejected.
//It is executed immediately after a promise's reject method is called.
//Here’s the syntax:


myPromise.catch(error => {
  // do something with the error.
});

//error is the argument passed in to the reject method.
Posted by: Guest on January-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language