exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 4 question 56 discussion

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

You have the following code. (Line numbers are included for reference only.)

You execute the code and you receive an alert that displays the following message: "Undefined".
You need to ensure that the alert displays as shown:

What should you do?

  • A. Replace line 13 with the following code:alert(e.message);
  • B. Replace line 06 with the following code:throw new eval("Oh no! ‘n’ is too small!")
  • C. Replace line 13 with the following code:alert(e);
  • D. Replace line 06 with the following code.throw new Error("Oh no! ‘n’ is too small!")
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
http://www.javascriptkit.com/javatutors/trycatch2.shtml

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
RubyH
Highly Voted 5 years, 3 months ago
Only valid answer is D (since you need to show full stack as well) -> see https://jsfiddle.net/5f68gcrn/2/
upvoted 7 times
nelaed
4 years, 11 months ago
Thanks, it's correct.
upvoted 2 times
...
...
dr_0verboost
Most Recent 4 years, 8 months ago
D is a valid answer
upvoted 2 times
...
KyryIx
5 years, 3 months ago
Should be C and D.
upvoted 1 times
...
Bennyseems
5 years, 3 months ago
Should be C.
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 ...