Summer Certification Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: force70

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 23 Topic 3 Discussion

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 23 Topic 3 Discussion

JavaScript-Developer-I Exam Topic 3 Question 23 Discussion:
Question #: 23
Topic #: 3

A developer wants to use a try...catch statement to catch any error that countSheep() may throw and pass it to a handleError() function.

What is the correct implementation of the try...catch?


A.

setTimeout(function() {

try {

countSheep();

} catch (e) {

handleError(e);

}

}, 1000);


B.

try {

countSheep();

} finally {

handleError(e);

}


C.

try {

countSheep();

} handleError (e){

catch(e);

}


D.

try {

setTimeout(function() {

countSheep();

}, 1000);

} catch (e) {

handleError(e);

}


Get Premium JavaScript-Developer-I Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.