HOTSPOT
For each of the following segments, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:
HOTSPOT
You evaluate the following code:
You need to determine the values of sampleStudent, sampleCourse.name, and sampleCourse.grade that are output by console.log(). What are the final values for the three variables? To answer, select the appropriate values in the answer area.
Hot Area:
HOTSPOT
You are creating a calendar application. You need to ensure that the code works correctly for all months of the year.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
HOTSPOT
You are designing a function that allows you to perform unit tests on other functions in a library. You will invoke each library function by using the eval JavaScript function. If an exception occurs when invoking a function, you want to display a
message box with the following message:
The function does not exist.
How should you complete the code? To answer, select the appropriate code segment in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
DRAG DROP
You are creating a web page that requests a username.
You create the following HTML form:
You need to write a function that retrieves the username from the form.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. Each function may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view
content.
NOTE: Each correct selection is worth one point.
Select and Place:
You are designing a web page with a script that must dynamically change the content of a paragraph element to display the value returned by the function randomQuote(). You have created the following code. Line numbers are included for reference only.
Which code segment should you use at line 08?
A. document.getElementById("tester").value = randomQuote();
B. document.getElementById("tester").title = randomQuote();
C. document.getElementById("tester").innerHTML = randomQuote();
D. document.getElementById("tester").script = randomQuote();
You are writing a JavaScript program for Contoso Suites that will output HTML.
You need to output each room type on a new line using the correct method.
You create the following code for the function. Line numbers are included for reference only.
You need to insert the correct code at Line 9. Which line should you use?
A. document.getElementById("body").innerHTML = rooms[i] + line.innerHTML;
B. document.getElementById("para").innerHTML += rooms[i] + line.innerHTML;
C. document.getElementById("para").innerHTML += i + rooms + line.innerHTML;
D. document.getElementById("body").innerHTML += rooms + i;
You are creating a web page that allows customers to choose how hot their spice is. If they choose spicy, a warning should be displayed. You create the following form. Line numbers are included for reference only.
You create the following JavaScript code to display the warning.
When you choose spicy and click Order, the warning fails to display.
You need to solve this problem.
What should you do?
A. Change line 07 to
B. Change line 07 to
C. Change line 10 to var option.value = document.forms.orderForm["heatIndex"];
D. Change line 10 to var option = document.forms.orderForm["heatIndex"].value;
This question requires that you evaluate the underlined text to determine if it is correct. You review the following JavaScript code:
When this code executes, the value of x is 0.
Review the underlined text. If it makes the statement correct, select "No change is needed". If the statement is incorrect, select the answer choice that makes the statement correct.
A. No change is needed
B. the value of x is 3
C. the value of x is 5
D. the value of x is undefined
You are creating a JavaScript program for an accounting system.
You create the following code. Line numbers are included for reference only.
You evaluate the code to ensure that it follows JavaScript best practices. Which two lines should you change?
A. 01
B. 02
C. 03
D. 04
E. 05