1.

What will be the reaction when a catch clause has no conditionals?(a) Takes it to be 0(b) Takes it to be 1(c) Takes it to be true(d) Takes it to be falseThe question was asked by my school teacher while I was bunking the class.My question is based upon Shorthand functions and Multiple catch clauses in chapter Classes and Modules in JavaScript of JavaScript

Answer»

Correct option is (C) Takes it to be TRUE

The explanation: The try and catch statement handles some or all of the errors that may occur in a block of code, while STILL running code. If a catch clause has no conditional, it BEHAVES as if it has the conditional if true, and it is always triggered if no clause before it was triggered.



Discussion

No Comment Found

Related InterviewSolutions