exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 42 discussion

Actual exam question from Microsoft's 70-480
Question #: 42
Topic #: 2
[All 70-480 Questions]

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;
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
* 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

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JMz123
5 years, 9 months ago
And why is this inheriting from Error ?
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...