Which line of code should you insert at line 09?

You are developing a JavaScript library.
You have the following requirements:
Custom exceptions must include an error message and custom error number.
These exceptions must be thrown when data validation errors occur.
Developers must call the library to easily catch the exception and identify the problem.
You develop the following code. (Line numbers are included for reference only.)

You need to complete the code to meet the requirements.
Which line of code should you insert at line 09?

You are developing a JavaScript library.
You have the following requirements:
Custom exceptions must include an error message and custom error number.
These exceptions must be thrown when data validation errors occur.
Developers must call the library to easily catch the exception and identify the problem.
You develop the following code. (Line numbers are included for reference only.)

You need to complete the code to meet the requirements.
Which line of code should you insert at line 09?

A.
throw new Validatior.Exception (123, “Day of week must be les3 than 7”);

B.
return new ValidationException(123, “Day of week must be less than 7”);

C.
throw ValidationException(123, “Day of week must be less than 7”);

D.
catch ValidationException(123, “Day of week: must be less than 7”);

Explanation:



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Pierpaolo

Pierpaolo

The correct answer should be B

grt

grt

I think its a typo in option A. It should be as below:

throw new ValidationException (123, “Day of week must be les3 than 7”);

Garry Potter

Garry Potter

Answer is correct. A.

lex

lex

Agree with grt. Typo in A otherwise it’s good.

YoYo

YoYo

A is correct.

90s laugh track

90s laugh track

” Hahahahaha “