1.

When will the finally block be called?(a) When there is no exception(b) When the catch does not match(c) When there is exception(d) After try-catch executionI have been asked this question in an interview.Asked question is from Shorthand functions and Multiple catch clauses topic in section Classes and Modules in JavaScript of JavaScript

Answer»

Correct answer is (d) After try-catch execution

To explain: The try and catch STATEMENT HANDLES some or all of the errors that may occur in a block of code, while STILL RUNNING code. A finally block is CALLED after try-catch execution.



Discussion

No Comment Found

Related InterviewSolutions