• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 11 pages
Exam (elaborations)

Javascript Practice Exam 2 Testing Questions And Answers

Document preview thumbnail
Preview 2 out of 11 pages

JAVASCRIPT PRACTICE EXAM 2 TESTING QUESTIONS AND ANSWERS

Content preview

JAVASCRIPT PRACTICE EXAM 2
TESTING QUESTIONS AND ANSWERS

You have a line of code in a webpage and want to make sure it displays only
if the browser a user is using does not support JavaScript.



Using drag and drop, drag the correct set of tags into the missing areas. Not
all tags will be used. - ANSWER-<noscript>

This browser does not support JavaScript.

</noscript>

For each statement regarding the use of external scripts, select Yes if the
statement is true or No if the statement is false. - ANSWER-External scripts
increase overall code security for websites. YES



If a variable is declared in both an inline script and an external script, the
inline script always takes precedence. NO



External scripts do not not need script tags within them. YES

A new developer is using the Console window within a browser to test code
for a new web app. The developer wants to be able to pause the code from
running to test the validity of variables within the code. Which methods can
the developer use to pause code as necessary? (Choose two) - ANSWER-add
a breakpoint



add the code word, debugger

Evaluate the following code:

rate = 5.99 document.getElementById("results").innerHTML =

parseInt("22 23") +

, parseFloat(" 25.99 is the price") +

parseInt(" The cat is 10") +

rate.toFixed(1);

What is the output of the code? - ANSWER-22 25.99 NaN 6.0

On a webpage that is used as a reporting page for your site, you are
attempting to display how many times the productList class is being used,
with the number of times the class is used to be displayed in a paragraph
with an ID of productListOutput.



Using the dropdown arrows, complete the function with the correct lines of
code. - ANSWER-var classList = document.getElementsByClassName



document.getElementById('productListOutput').innerHTML

You are writing code to generate a random number of 0, 1, or 2 so that a
song can be played based on the number generated.



Using drag and drop, fill in the variable declaration for the songNumber
variable. - ANSWER-Math.floor



Math.random



3

In the following code example, use the dropdown lists to complete the code
so that it will do the following:



Attempt to display an order total.



Display the message "You have a problem" and the error message if there is
an error.

Document information

Uploaded on
November 1, 2025
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EduSprint
3.9
(8)
Sold
69
Followers
5
Items
7078
Last sold
1 week ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions