Test Chapter 6 JavaScript Introduction To Scripting Quizlet
Test Chapter 6 JavaScript Introduction To Scripting Quizlet
NAME
14 Written questions
CORRECT
2. 6.6 Consider the following script. What is wrong with the following code?
<script type = "text/javascript">
var firstNumber;
thirdNumber;
CORRECT
CORRECT
CORRECT
https://quizlet.com/138542620/test?answerTermSides=4&promptTermSides=6&questionCount=14&questionTypes=1&showImages=true 1/4
1/17/2021 Test: Chapter 6: JavaScript: Introduction to Scripting | Quizlet
5. 6.1 In the following line the word document is a(n) ______ that resides in the computer's memory.
document.writeln("Hello World");
a) attribute
b) behavior
c) object
d) method
CORRECT
6. 6.8 What will the browser display if the following script is executed and the user enters 5 at both prompts?
<script type = "text/javascript">
<!--
var firstNumber = window.prompt( "Enter an integer", "0" );
var secondNumber= window.prompt( "Enter an integer", "0" );
var thirdNumber;
thirdNumber = firstNumber + secondNumber;
document.write( thirdNumber );
//-->
</script>
a) nothing
b) 0
c) 10
d) 55
CORRECT
7. 6.5 An alert dialog displaying the text "Welcome!" is created by calling _________.
a) window.alert( "Welcome!" );
b) alert.window( "Welcome!" );
c) window( "alert = \"Welcome!\"" );
d) window( "<alert> Welcome! </alert>" );
CORRECT
8. 6.13 Which of the following is not a valid JavaScript equality or relational operator?
a) =
b) <
c) >
c)!=
CORRECT
https://quizlet.com/138542620/test?answerTermSides=4&promptTermSides=6&questionCount=14&questionTypes=1&showImages=true 2/4
1/17/2021 Test: Chapter 6: JavaScript: Introduction to Scripting | Quizlet
What would a browser capable of scripting display when executing this code?
a) document.writeln("Hello World");
b) nothing
c) Hello World
d) <html>
<script type = "text/javascript">
<!--
<!-- document.writeln("Hello World </p>");
//-->
</script>
</html>
CORRECT
CORRECT
CORRECT
12. 6.4 Which of the following statements would correctly print out the sentence "Hello World" in blue?
a) document.write( "<p style = \"color: blue\");
document.write( "Hello World >");
b) document.write( "<p> style = \"color: blue\" Hello World </p>);
c) document.write( "<p style = \"color: blue\" Hello World + "</p>");
d) document.write( "<p style = \"color: blue\">");
document.write( "Hello World </p>");
CORRECT
https://quizlet.com/138542620/test?answerTermSides=4&promptTermSides=6&questionCount=14&questionTypes=1&showImages=true 3/4
1/17/2021 Test: Chapter 6: JavaScript: Introduction to Scripting | Quizlet
13. 6.11 Which of the following sequences does not follow the rules of operator precedence? Assume that operators are evaluated
in the order listed from left to right.
a) multiplication, division, addition
b) parentheses, subtraction, modulus
c) division, multiplication, addition
d) parentheses, modulus, subtraction
CORRECT
14. 6.2 In the following line, the word writeln is a(n) _________ that performs a task or action in the script.
document.writeln("Hello World");
a) structure
b) collection
c) object
d) method
CORRECT
https://quizlet.com/138542620/test?answerTermSides=4&promptTermSides=6&questionCount=14&questionTypes=1&showImages=true 4/4