98-382 Exam Questions
40 real 98-382 exam questions with expert-verified answers and explanations. Page 1 of 1.
- Question #1
You need to write a loop that will traverse the length of an array to find the value orange. If an array element value is null, the code should immediately go to the next element....
- Question #2
You are creating a JavaScript function that returns a date the specified number of months in the future of the current date. The function must meet the following requirements: - Ac...
- Question #3
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...
- Question #4
Evaluate the following code. Line numbers are included for reference only. 01 var n = 50; 02 var c = n + 5; 03 var a = n % 2; 04 var d = c / 11; 05 n = d * 2; 06 console.log(n, c,...
- Question #5
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...
- Question #6
What should you do?
- Question #7
You are evaluating a colleague's code to ensure it meets best practices. For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each...
- Question #8
You are creating a function that does safe division. The function has the following requirements: => The function receives two parameters for the numerator and denominator. => If t...
- Question #9
You are creating a web page that requests a username. You create the following HTML form: ```html <form id="credentials" action="#" method="get"> <p>Username: <input type="text" id...
- Question #10
Variable x has a value of 5. Variable y has a value of 7. For each of the following expressions, select True if the statement evaluates to true. Otherwise, select False. NOTE: Each...
- Question #11
Evaluate the truth value of each expression below.
- Question #12
You analyze the following code fragment. Line numbers are included for reference only. ```javascript 01 "use strict"; 02 var val1 = 25; 03 var val2 = 4; 04 function multiply() { 05...
- Question #13
Declares and initializes an array Fills the array with 10 random integers Adds every other number starting with the first element How should you complete the code? To answer, selec...
- Question #14
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 given a partial JavaS...
- Question #15
You need to determine the values of sampleStudent.name, sampleCourse.name, and sampleCourse.grade that are output by console.log(). What are the final values for the three variable...
- Question #16
Your instructor has asked you to implement code that would display a two-dimensional array of any size inside a <div> tag. You write the following code: ```javascript var div = doc...
- Question #17
This question requires that you evaluate the underlined text to determine if it is correct. You review the following JavaScript code: ```javascript var x = 15; x %= 5; ``` When thi...
- Question #18
You are creating JavaScript code that manipulates dates. You want to initialize a Date object with the date January 1, 2017 by using the year, month, and date parameters. How shoul...
- Question #19
You are creating a JavaScript program for an accounting system. You create the following code. Line numbers are included for reference only. ```javascript 01 var firstName = "Jo";...
- Question #20
What is the data type for line 01?
- Question #21
What is the data type for line 04?
- Question #22
What is the data type for line 05?
- Question #23
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 approp...
- Question #24
You are creating a function named countdown. The function accepts a single parameter, start, and displays a countdown from that number down to zero in increments of one. How should...
- Question #25
You are planning to use the Math object in a JavaScript application. You write the following code to evaluate various Math functions: ```javascript var ceil = Math.ceil(100.5); var...
- Question #26
For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each correct selection is worth one point. Statements: 1. External JavaScript...
- Question #27
You are creating a web page with a script. The script will insert the window's location inside the page's input element. How should you complete the code? To answer, drag the appro...
- Question #28
The ABC company offers a mid-week discount of 10% on Wednesdays. You need to write a JavaScript function that meets the following requirements: -> Accepts the day of the week as a...
- Question #29
You are designing a web page that contains a list of animals. The web page includes a script that outputs animals from a list. You create the following HTML to test the script: ```...
- Question #30
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 cre...
- Question #31
You are writing a function that calculates the remainder for integer division. The function receives two parameters, a and b, and must return the remainder that is left over when t...
- Question #32
You are designing a web page that contains a blue button. When the button is pressed, it should call a function that displays the message 'Welcome!'. When the cursor hovers over th...
- Question #33
You are developing a web page that uses JavaScript. The script needs to display information to the user using a popup box. Match each function that displays a popup box with its ap...
- Question #34
You need to evaluate the following code segment. Line numbers are included for reference only. ```javascript 01 var n; 02 console.log(typeof n); 03 var a = "3.4"; 04 console.log(ty...
- Question #35
For each of the following segments, select Yes if the statement is true. Otherwise, select No. Statements: 1. When using a GET request with a form, the data length is restricted. 2...
- Question #36
You are creating a web page that tests a user's ability to accurately type text. The validation should be case-insensitive. How should you complete the code? To answer, move to ans...
- Question #37
You are using JavaScript to create a calculator. You create the following HTML. Line numbers are included for reference only. 01 <form id="calculator"> 02 <input type="text" id="a"...
- Question #38
A JavaScript array is initialized as follows: `var array = [20, 40, 60, 80];` You write the following code to manipulate the array: `array.shift();` `array.pop();` `array.push(10);...
- Question #39
You are creating a dynamic HTML page by using JavaScript. Your page has an image of the sun. When the user's mouse pointer moves across the image of the sun, the image should chang...
- Question #40
You are using JavaScript to create a function that calculates admission price. The function must meet the following requirements: ⇨ The function accepts the age of the customer as...