ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 65 - Certified JavaScript Developer I discussion

Report
Export

A developer wrote the following code:

01 let X = object.value;

02

03 try {

04 handleObjectValue(X);

05 } catch (error) {

06 handleError(error);

07 }

The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs.

How can the developer change the code to ensure this behavior?

A.
03 try{04 handleObjectValue(x);05 } catch(error){06 handleError(error);07 } then {08 getNextValue();09 }
Answers
A.
03 try{04 handleObjectValue(x);05 } catch(error){06 handleError(error);07 } then {08 getNextValue();09 }
B.
03 try{04 handleObjectValue(x);05 } catch(error){06 handleError(error);07 } finally {08 getNextValue();10 }
Answers
B.
03 try{04 handleObjectValue(x);05 } catch(error){06 handleError(error);07 } finally {08 getNextValue();10 }
C.
03 try{04 handleObjectValue(x);05 } catch(error){06 handleError(error);07 }08 getNextValue();
Answers
C.
03 try{04 handleObjectValue(x);05 } catch(error){06 handleError(error);07 }08 getNextValue();
D.
03 try {04 handleObjectValue(x)05 ……………………
Answers
D.
03 try {04 handleObjectValue(x)05 ……………………
Suggested answer: D
asked 23/09/2024
Mohammed Meddah
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first