which order should you arrange the code blocks to devel…

DRAG DROP
You have a function named getContent that returns a string.
Sometimes, the function throws an exception.
You need to develop a method named writeContent. writeContent must generate an HTML page that contains
the following:
the text “Welcome”
the content returned by thegetContentmethod or the exception message of an exception thrown by
thegetContentmethod
the text “Bye”
In which order should you arrange the code blocks to develop the solution? To answer, move all code blocks
from the list of code blocks to the answer area and arrange them in the correct order.
Select and Place:

DRAG DROP
You have a function named getContent that returns a string.
Sometimes, the function throws an exception.
You need to develop a method named writeContent. writeContent must generate an HTML page that contains
the following:
the text “Welcome”
the content returned by thegetContentmethod or the exception message of an exception thrown by
thegetContentmethod
the text “Bye”
In which order should you arrange the code blocks to develop the solution? To answer, move all code blocks
from the list of code blocks to the answer area and arrange them in the correct order.
Select and Place:

Answer:

Explanation:
try {
document.write(“Welcome<br/>”);
document.write(getContent());
}
catch (e) {
document.write(“getContent() throws an exception:” + e.message + “<br/>”);
}
finally {
document.write(“
Bye”);
}
https://docs.microsoft.com/en-us/scripting/javascript/reference/try-dot-dot-dot-catch-dot-dot-dotfinally-statement-javascript



Leave a Reply 0

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