Exam 9: Additional Javascript Basics: Window Object, If Statement, Strings, Numbers, and Input Validation

arrow

13,626 students have unlocked this exam

  • Select Tags
search iconSearch Question
  • Select Tags

A dialog box is a control that supports verbal two-way communication between the user and the computer.

Free
(True/False)
4.9/5
(43)
Correct Answer:
Verified

False

Provide a functionally equivalent, shorter version of the following code: window.document.getElementById["name"]

Free
(Short Answer)
4.8/5
(43)
Correct Answer:
Verified

document.getElementById["name"]

When should you use dialog boxes (alert, confirm, and prompt) for input and output?

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

B

How can you test two strings to see if they are equal?

(Multiple Choice)
4.9/5
(42)

When the following code executes, what message does the dialog box display? var month = "January"; if (month.toLowerCase() == "january") { alert("It is " + month + "!"); }

(Short Answer)
4.7/5
(33)

To break/split a string in JavaScript, you should terminate the first part of the string with a closing quote, insert a(n) ______, and start the next line's continuation string with an opening quote.

(Short Answer)
4.8/5
(43)

The following code generates a dialog box that contains a question and an input box: prompt("What's your favorite color?", ""); Initially, what displays inside the input box?

(Short Answer)
4.7/5
(40)

What does the following expression evaluate to? 39 % 10 / 4

(Short Answer)
4.9/5
(41)

The output element is for holding the result of a user's action.

(True/False)
4.8/5
(44)

Suppose a variable x holds "dog". After the following code gets executed, what does x hold? x += "fish";

(Short Answer)
4.7/5
(33)

What is the syntax for generating a dialog that displays a message and does not receive input?

(Multiple Choice)
4.8/5
(32)

The <code>window</code> object's <code>screen</code> property holds information about the monitor that is being used.

(True/False)
4.8/5
(33)

A(n) __________ is a pictorial representation of the logic flow of a computer program.

(Short Answer)
4.9/5
(42)

Proper coding conventions suggest that when there are JavaScript statements inside of braces ({}), you should do which of the following?

(Multiple Choice)
4.8/5
(42)

After the following code executes, what does x hold? var animal = "porcupine"; var x = animal.lastIndexOf("p", 3);

(Short Answer)
4.8/5
(33)

How can you round a price variable's value to the hundredths place (e.g., 204.89)?

(Multiple Choice)
4.8/5
(41)

A block statement (zero or more statements surrounded by braces) can be used anywhere a standard statement can be used.

(True/False)
4.7/5
(43)

For the "if, else if, else" form of the if statement, if a condition is found to be true, that condition's block statement is executed. Then, all the other conditions are skipped, and control flows down to the statement below the entire if statement.

(True/False)
4.9/5
(38)

The window object is known as the global object because all of its members are global.

(True/False)
4.8/5
(33)

Suppose you have a variable named character. What is the best way to assign a double quote (") to character?

(Multiple Choice)
4.8/5
(33)
Showing 1 - 20 of 30
close modal

Filters

  • Essay(0)
  • Multiple Choice(13)
  • Short Answer(10)
  • True False(7)
  • Matching(0)