Which line of code should you insert at line 04?

Posted by: Pdfprep Category: 70-480 Tags: , ,

You create an application that sends information to a web service by using the following code: (Line numbers are included for reference only.)

When the web service returns a non-zero result code, you must raise an exception that contains the result code.

You need to implement the code that generates the exception.

Which line of code should you insert at line 04?
A . CustomError.prototype = Error.prototype;
B . CustomError ["ErrorType"] = Error;
C . CustomError.customError = true;
D . Error-constructor = CustomError;

Answer: A

Explanation:

* Object.prototype.constructor

Returns a reference to the Object function that created the instance’s prototype. Note that the value of this property is a reference to the function itself, not a string containing the function’s name. The value is only read-only for primitive values such as 1, true and "test".

* The constructor property is created together with the function as a single property of func.prototype.

Reference: Object.prototype.constructor

Leave a Reply

Your email address will not be published.