You need to ensure that the alert displays as shown: …

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?

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!”)

Explanation:
http://www.javascriptkit.com/javatutors/trycatch2.shtml



Leave a Reply 1

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


Michał

Michał

It is right.