Question
QUESTION 1 What is wrong with this test? if(x = 9) the test for equality requires 2 equal signs nothing is wrong the test should
QUESTION 1
-
What is wrong with this test? if(x = 9)
the test for equality requires 2 equal signs
nothing is wrong
the test should be enclosed in square brackets, not parentheses.
2 points
QUESTION 2
-
To return a value from a function you use a return statement.
True
False
2 points
QUESTION 3
-
The onclick() event handler can be assigned ______
to pretty much any HTML element on the page.
only to html form elements
only to buttons
2 points
QUESTION 4
-
"To make this condition true, if( x == 6 && y < 0)"
x must equal 6 and also y must be negative at the same time
y must equal 8, x can be anything
x must equal 6, y can be anything
y must equal 0, x can be anything
2 points
QUESTION 5
-
To open up a pop-up dialog box using JavaScript you would use the _____ method.
alert()
message()
dialog()
msg()
2 points
QUESTION 6
-
"This condition, if(x = 20)"
will always evaluate to true
will always evaluate to false
how it evaluates depends on what x was assigned before the test.
2 points
QUESTION 7
-
What does array x look like after these lines execute?
var x = [2, 4, 6, 8, 10]; x[2] = 19;
"x = [2, 4, 19, 8, 10]"
"x = [2, 4, 6, 19, 10]"
x = [19]
"x = [2, 19, 6, 8, 10]"
2 points
QUESTION 8
-
What is x after this code runs?
str = "Red Betelgeuse"; x = str.substr(4, 5);
"Betel"
"etelg"
20
" Bete"
2 points
QUESTION 9
-
In this function declaration,
function add(x, y) { alert(x+y); }
x and y are called parameters
x and y are called arguments
x and y are called addends
2 points
QUESTION 10
-
Some advantages of placing your JavaScript code in a separate file are _____. Choose 2 answers
the code is easier to maintain.
an update to the code is immediately available to all pages that use the file.
any errors in the code will be ignored
the user can easily see the code
2 points
QUESTION 11
-
You have this code. Pick the best answer from below.
function addNumbers() { var n1 = document.form1.txt1.value; var n2 = document.form1.txt2.value; var sum = n1 + n2; document.form1.txt3.value = sum; }
either mis-naming the form or a textbox in the form could cause an error
you would get an error only if you had no textbox in the form named txt1 or txt2
there is no way anything could possibly go wrong.
you would get an error only if your html form was not named form1
2 points
QUESTION 12
-
The _____ is an international organization that develops open standards to promote the long-term development of the World Wide Web.
World Wide Web Consortium (W3C)
Modern Schema Division (MSD)
Data Modification vehicle (DMV)
Distance Article Readers (DAR)
2 points
QUESTION 13
-
The Boolean value false is associated with the number 0.
True
False
2 points
QUESTION 14
-
A global variable lives in memory ____.
as long as the web page is open.
for about a week
none of the other answers are true
for only as long as a function executes
2 points
QUESTION 15
-
parseFloat() and parseInt() are used to _____
force the conversion of a string to a number
force the conversion of a number to a string
2 points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started