98-382 無料問題集「Microsoft Introduction to Programming Using JavaScript」
HOTSPOT
You are planning to use the Math object in a JavaScript application. You write the following code to evaluate various Math functions:

What are the final values for the three variables? To answer, select the appropriate values in the answer area.
NOTE: Each correct selection is worth one point.

You are planning to use the Math object in a JavaScript application. You write the following code to evaluate various Math functions:

What are the final values for the three variables? To answer, select the appropriate values in the answer area.
NOTE: Each correct selection is worth one point.

正解:

Explanation:

References: https://www.w3schools.com/js/js_math.asp
DRAG DROP
You are using JavaScript to create a calculator.
You create the following HTML. Line numbers are included for reference only.

You must create a function named add() that adds the values in the a and b input elements and displays the result in the result input element.
You define the following function in JavaScript:
function add() {
}
You need to complete the body of the function.
Which three code segments should you use to develop the solution? To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.
NOTE: Each correct selection is worth one point.

You are using JavaScript to create a calculator.
You create the following HTML. Line numbers are included for reference only.

You must create a function named add() that adds the values in the a and b input elements and displays the result in the result input element.
You define the following function in JavaScript:
function add() {
}
You need to complete the body of the function.
Which three code segments should you use to develop the solution? To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.
NOTE: Each correct selection is worth one point.

正解:

Explanation:

References: https://www.w3schools.com/jsref/jsref_eval.asp
HOTSPOT
You need to evaluate the following code segment. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.

You need to evaluate the following code segment. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.

正解:

HOTSPOT
You are using JavaScript to write a safe root math utility that has the following requirements:
Given the function safeRoot(a, b):
* If the radicand (a) is non-negative, return Math.pow (a, 1/b);
* Otherwise,
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.

You are using JavaScript to write a safe root math utility that has the following requirements:
Given the function safeRoot(a, b):
* If the radicand (a) is non-negative, return Math.pow (a, 1/b);
* Otherwise,
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.

正解:

Explanation:

References: https://www.w3schools.com/js/js_if_else.asp