Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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.
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #catch #javascript
ADD COMMENT
Topic
Name
8+7 =