Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

await and catch javascript

var response = await promisedFunction().catch((err) => { console.error(err); });
// response will be undefined if the promise is rejected
// this will work instead of using try...catch...
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #await #catch #javascript
ADD COMMENT
Topic
Name
5+9 =