Professional Documents
Culture Documents
Question # 2 (Multiple Choice) If x=3, then the statement y=x++ sets __________.
A) y to 3, increments x to 4
B) y to 4, increments x to 4
C) It is impossible to answer this without more information.
D) Both a and b are correct.
Question # 3 (Multiple Choice) What property reveals the operating system of the
client computer?
A) appName
B) userAgent
C) appVersion
D) OsVersion
Question # 4 (Multiple Choice) When using the "+" operator with two strings, the
effect can best be described as ________.
A) addition
B) comparison
C) combination
D) concatenation
Question # 6 (Multiple Choice) ________ are the specific property that will be
used.
A) Properties
B) Methods
C) Function
D) Values
1
JAVA SCRIPT
Question # 7 (Multiple Choice) ________ are the actions that the object property
can be made to perform, such as calculation or writing of text.
A) Functions
B) Event handlers
C) Methods
D) Operations
Question # 14 (Multiple Choice) If you delete cookies.txt from your hard drive,
what will be the consequence?
A) Some websites may not operate correctly.
B) Another cookies.txt file will be created automatically.
C) Netscape will extract information from its backup cookies file.
D) Netscape will need to be re-installed.
2
JAVA SCRIPT
3
JAVA SCRIPT
Question # 22 (Multiple Answer) Alert boxes ________.
A) annoy the user
B) increase interaction with the web page
C) can request info from the user to be stored as a variable
D) can display the current value of a variable, making them excellent for
troubleshooting
Question # 26 (Multiple Choice) Which of the following is the most commonly used
Javascript version?
A) 1.2
B) 1.3
C) 1.4
D) 1.5
Question # 34 (True/False) Some people turn off their cookies because cookies
can inadvertently spread viruses.
A) True
B) False
A) do....while
B) break
C) switch
D) continue
Question # 42 (Multiple Choice) ________ relates the principal that some objects
cannot be used or referenced without referring to the parent, or container,
object.
A) Containership
6
JAVA SCRIPT
B) Inheritance
C) SOM
D) DOME
Question # 46 (Multiple Choice) The checked property for the checkbox object
returns ________.
A) true or false
B) the value of the object
C) the name of the object
D) a string
Question # 53 (Multiple Answer) Which of the following let you jump out of an
iterating loop?
A) abort
B) Q
C) break
D) continue
Question # 54 (Multiple Choice) What is the primary problem with the following
Javascript code?
<HTML>
<HEAD>
JavaScript Testing Page
<SCRIPT>
//The following code will be for the form
validation.
. . . make believe there is script here
</SCRIPT>
</HEAD>
<BODY></BODY>
</HTML>
A) The LANGUAGE="JavaScript" is missing from the script tag.
B) The comments are done incorrectly.
C) There is no form in the body
D) There is no title tag.
8
JAVA SCRIPT
Correct Answers
1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 ,
19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 ,
35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 ,
51 , 52 , 53 , 54 , 55
Question # 1 (Multiple Choice) Variables are declared in Javascript using which
of the following?
Answer: (B) var
BACK
Question # 2 (Multiple Choice) If x=3, then the statement y=x++ sets __________.
Answer: (A) y to 3, increments x to 4
BACK
Question # 3 (Multiple Choice) What property reveals the operating system of the
client computer?
Answer: (B) userAgent
BACK
Question # 4 (Multiple Choice) When using the "+" operator with two strings, the
effect can best be described as ________.
Answer: (D) concatenation
BACK
Question # 5 (Multiple Choice) Which of the following assignment operators
assigns the value of the second operand to the first operand?
Answer: (A) =
BACK
Question # 6 (Multiple Choice) ________ are the specific property that will be
used.
Answer: (D) Values
BACK
Question # 7 (Multiple Choice) ________ are the actions that the object property
can be made to perform, such as calculation or writing of text.
Answer: (C) Methods
BACK
Question # 8 (Multiple Choice) If you have a series of five alerts in a row,
which of the following will occur?
Answer: (B) Each will appear in the order they appear in the script, as the user
clicks through them one at a time.
BACK
Question # 9 (Multiple Answer) If a file has a "runtime error", it is most
likely caused by which of the following?
(B) Mismatched data types appear when functions called
BACK
Question # 10 (Multiple Choice) Which of the following bitwise operators flips
the bits of its operand?
Answer: (A) ~
BACK
Question # 11 (Multiple Choice) The location of cookies for Netscape is
________.
Answer: (B) cookies.txt
BACK
9
JAVA SCRIPT
Question # 12 (True/False) Scripts placed in the body of a web document are
processed before scripts placed in the head.
Answer: False
BACK
Question # 13 (Multiple Choice) Which of the following is possible in
Javascript?
Answer: (D) Preprocess data on the client before submission to the server.
BACK
Question # 14 (Multiple Choice) If you delete cookies.txt from your hard drive,
what will be the consequence?
Answer: (B) Another cookies.txt file will be created automatically.
BACK
Question # 15 (Multiple Choice) x/y is the same as ________.
Answer: (B) divides x by y
BACK
Question # 16 (Multiple Choice) Why would anyone choose to use cookies?
Answer: (C) store preferences of user
BACK
Question # 17 (Multiple Choice) What would be the results of
document.write(anyString.substring(4,7)) on "Netscape"?
Answer: (A) cap
BACK
Question # 18 (Multiple Choice) Which of the following is the highest in the
Javascript object model hierarchy?
Answer: (B) form
BACK
Question # 19 (Multiple Choice) firstName="John"
lastName="Doe"
fullname= firstName+lastName
In the code above, which of the following will be the result?
Answer: (B) JohnDoe
BACK
Question # 20 (Multiple Answer) Which of the following bitwise operations are
correct?
(B) 15&9 yields 9
BACK
Question # 21 (Multiple Choice) Which command holds values in a named space of
memory?
Answer: (B) variable
BACK
Question # 22 (Multiple Answer) Alert boxes ________.
(A) annoy the user
(D) can display the current value of a variable, making them excellent for
troubleshooting
BACK
Question # 23 (Multiple Choice) Which of the following bitwise operators returns
10
JAVA SCRIPT
a one in each bit position if bits of both operands are ones?
Answer: (B) &
BACK
Question # 24 (Multiple Choice) In the expression ("Hello," + "Mary"), the +
operator is ________.
Answer: (C) concatenation
BACK
Question # 25 (Multiple Choice) What version of Javascript was first supported
by Netscape browser?
Answer: (B) 2
BACK
Question # 26 (Multiple Choice) Which of the following is the most commonly used
Javascript version?
Answer: (A) 1.2
BACK
Question # 27 (Multiple Choice) The following dot notation is referring to which
object?
window.document.body.form.radio
Answer: (B) radio
BACK
Question # 28 (Multiple Choice) The following code is used to ________.
setTimeout ("changePage()", 3000);
function changePage() {
if (self.parent.frames.length != 0)
self.parent.location="http://your-site.com";
}
(B) alert()
The alert box lets you know you've made it to a certain line in the script,
comments let you temporarily delete sections that may not be working properly.
BACK
Question # 30 (Multiple Choice) Which of the following is used to insert a
backslash?
Answer: (A) \\
BACK
Question # 31 (Multiple Choice) If you use an external Javascript file,
additional code in between the script tags ________.
Answer: (C) will be ignored
BACK
Question # 32 (Multiple Choice) IE stores cookies ________.
Answer: (B) in a directory called "cookies"
BACK
Question # 33 (True/False) Javascript is similar to HTML in that it is not
case-sensitive.
11
JAVA SCRIPT
Answer: False
BACK
Question # 34 (True/False) Some people turn off their cookies because cookies
can inadvertently spread viruses.
Answer: False
BACK
Question # 35 (Multiple Choice) Clicking a mouse button, running out of memory,
and placing a cursor in a form field are all known as ________.
Answer: (C) events
BACK
Question # 36 (Multiple Choice) The following is an example of a ________
statement.
{
case "Oranges" :
document.write("Oranges are $0.59 a pound.<BR>");
break;
case "Apples" :
document.write("Apples are $0.32 a pound.<BR>");
break;
case "Bananas" :
document.write("Bananas are $0.48 a pound.<BR>");
break;
case "Cherries" :
document.write("Cherries are $3.00 a pound.<BR>");
break;
default :
document.write("Sorry, we are out of " + i + ".<BR>");
}
(D) continue
13
JAVA SCRIPT
BACK
Question # 54 (Multiple Choice) What is the primary problem with the following
Javascript code?
<HTML>
<HEAD>
JavaScript Testing Page
<SCRIPT>
//The following code will be for the form
validation.
...make believe there is script here
</SCRIPT>
</HEAD>
<BODY></BODY>
</HTML>
Answer: (B) The comments are done incorrectly.
BACK
Question # 55 (Multiple Choice) Which of the following assignment operators
performs a left shift and assigns the result to the first operand?
Answer: (C) <<=
BACK
Question # 3 (True/False) All functions should be in the head section of the web
document.
A) True
B) False
Question # 9 (Multiple Choice) Each pass through a loop is called a/n ________.
A) switch
B) repeater
C) iteration
D) batch
Question # 11 (Multiple Choice) The first slot in an array has an indexed number
of ________.
A) 0
B) 1
C) 101
D) There is not enough information to answer this question.
Question # 20 (Multiple Choice) Which of the following shows proper syntax for
declaring an array?
16
JAVA SCRIPT
A) months = array("Jan","Feb","Mar")
B) array = months("Jan","Feb","Mar")
C) months = new array("Jan","Feb","Mar")
D) array months("Jan","Feb","Mar")
A) True
B) False
Question # 28 (Multiple Choice) How many cookies are allowed per domain?
A) It depends on the domain extension (com vs. gov).
B) 1
C) 1 in IE, 20 in Netscape
D) It depends on the expiration dates.
18
JAVA SCRIPT
Question # 34 (Multiple Answer) Which of the following is not an event handler?
A) onDragDrop
B) onError
C) onScroll
D) onKeyup
E) onRoute
Question # 38 (Multiple Answer) What are some of the common benefits of form
field validation?
A) faster browser loading
B) increased user satisfaction
C) validity of form submission
D) increased security
E) faster server processing
Question # 42 (Multiple Choice) If the system root is on drive c:, the location
of cookies for IE is ________.
19
JAVA SCRIPT
A) c:\windows\cookies
B) cookies.txt
C) c:\windows\system\cookies
D) c:\cookies
A) 2
B) 4
C) 1
D) It is impossible to say.
Question # 55 (Multiple Choice) The following code ________ when the user clicks
the button.
<form>
<p><font face="MS Sans Serif"><input TYPE="Button" VALUE="Back up"
onClick="history.go(-1);"> </font></p>
</form>
A) goes back one page
B) goes back two pages
C) reloads the page
D) It is impossible to say without knowing the prior history.
Correct Answers
1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 ,
19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 ,
35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 ,
51 , 52 , 53 , 54 , 55
21
JAVA SCRIPT
Question # 1 (Multiple Choice) What is Javascript's default object?
Answer: (C) window
BACK
Question # 2 (Multiple Choice) ________ represent various attributes such as
height, color, font-size, sentence length, and so on.
Answer: (B) Properties
BACK
Question # 3 (True/False) All functions should be in the head section of the web
document.
Answer: True
BACK
Question # 4 (Multiple Choice) Which of the following logical operators returns
true if both logical operands are true?
Answer: (A) &&
BACK
Question # 5 (Multiple Answer) Which of the following should be avoided in
Javascript for increased accessibility by the disabled?
(A) onMouseover
BACK
Question # 6 (Multiple Choice) The following shorthand x+=y is the same as
________.
Answer: (C) x=x+y
BACK
Question # 7 (Multiple Choice) ECMA script most closely resembles Javascript
________.
Answer: (B) 1.1
BACK
Question # 8 (Multiple Choice) The target attribute value "blank"________.
Answer: (B) opens a file in a frame named blank
BACK
Question # 9 (Multiple Choice) Each pass through a loop is called a/n ________.
Answer: (C) iteration
BACK
Question # 10 (Multiple Choice) Why are Javascript commands contained within
HTML comment tags?
Answer: (A) So commands won't display in non-javascript enabled browsers.
BACK
Question # 11 (Multiple Choice) The first slot in an array has an indexed number
of ________.
Answer: (A) 0
BACK
Question # 12 (Multiple Choice) Javascript is considered ________ scripting.
Answer: (A) client-side
BACK
Question # 13 (Multiple Choice) Which of the following is used to insert a
carriage return?
Answer: (A) \r
BACK
Question # 14 (Multiple Choice) Which of the following bitwise operators shifts
its first operand in binary representation the number of bits to the left
22
JAVA SCRIPT
specified in the second operand, shifting in zeros from the right?
Answer: (D) <<
BACK
Question # 15 (Multiple Choice) Which of the following is used to insert a new
line?
Answer: (B) \n
BACK
Question # 16 (True/False) document.textField and document["textField"] are both
valid ways to refer to the same object.
Answer: True
BACK
Question # 17 (True/False) The confirm() method returns a value of true or
false.
Answer: True
BACK
Question # 18 (Multiple Choice) Which of the following adds one to a variable
representing a number?
Answer: (A) ++
BACK
Question # 19 (Multiple Choice) In the expression (3*4), the * operator is
________.
Answer: (B) multiplication
BACK
Question # 20 (Multiple Choice) Which of the following shows proper syntax for
declaring an array?
Answer: (C) months = new array("Jan","Feb","Mar")
BACK
Question # 21 (Multiple Choice) In the following code, line number ______
contains the name of the function and the argument num that we will pass when we
call the function.
1. function rollOn(num){
2. if(document.images){
3. eval('document.images["norm'+num+'"].src
4. ='+'over[num].src')}
5. }
Answer: (A) 1
BACK
Question # 22 (Multiple Choice) Who designed and developed Javascript?
Answer: (B) Netscape
BACK
Question # 23 (True/False) The language attribute in the script tag is optional.
Answer: True
BACK
Question # 24 (Multiple Answer) Which of the following are proper variable
names?
(C) firstText
(E) _var
BACK
Question # 25 (Multiple Choice) What version of Javascript was first supported
by Internet Explorer?
Answer: (C) 3
23
JAVA SCRIPT
BACK
Question # 26 (Multiple Choice) Which of the following are not Javascript
reserved words?
Answer: (D) first
BACK
Question # 27 (Multiple Choice) The following _________.
function confirm(){if (confirm("Do you hold us harmless from all legal action?
"))
location="http://www.xxx.com";return " "}
document.writeln(confirm())
(E) onRoute
BACK
Question # 35 (Multiple Choice) ________ terminates the current while or for
loop and transfers program control to the statement following the terminated
loop.
Answer: (D) Break
BACK
Question # 36 (Multiple Choice) Which of the following is a method?
Answer: (D) prompt()
BACK
24
JAVA SCRIPT
Question # 37 (True/False) getMonth() retrieves the month name (January,
February, etc.).
Answer: False
Retrieves values #0-11 BACK
Question # 38 (Multiple Answer) What are some of the common benefits of form
field validation?
(B) increased user satisfaction
BACK
Question # 39 (Multiple Choice) What is the purpose of the noscript tag?
Answer: (B) Display info for browsers that have Javascript turned off.
BACK
Question # 40 (Multiple Choice) Javascript's original name was ________.
Answer: (C) livescript
BACK
Question # 41 (True/False) Javascript is object-based and Java is
object-oriented.
Answer: True
BACK
Question # 42 (Multiple Choice) If the system root is on drive c:, the location
of cookies for IE is ________.
Answer: (A) c:\windows\cookies
BACK
Question # 43 (Multiple Choice) If x=3, then the statement y=++x sets
__________.
Answer: (A) y to 4, increments x to 4
BACK
Question # 44 (Multiple Choice) Netscape ________.
Answer: (D) appends cookies into one large file called cookies.txt
BACK
Question # 45 (Multiple Choice) Which of the following syntax is correct for
commenting multiple lines in Javascript?
Answer: (B) /* Comments */
BACK
Question # 46 (True/False) JavaScript variables are loosely typed, meaning that
any variable can represent both a string of characters and a number, depending
solely upon what was assigned.
Answer: True
BACK
Question # 47 (Multiple Choice) The following returns ________.
function square(i) {
document.write("The call passed ", i ," to the function.","<BR>")
return i * i } document.write("The function returned ",square(2),".")
Answer: (B) 4
BACK
Question # 48 (Multiple Choice) External Javascript files have a ________
extension.
Answer: (D) .js
25
JAVA SCRIPT
BACK
Question # 49 (Multiple Choice) Which of the following comparison operators
returns true if the operands are equal?
Answer: (A) ==
BACK
Question # 50 (Multiple Choice) Comparison operators ________.
Answer: (B) return true or false
BACK
Question # 51 (True/False) The Javascript object hierarchy model is divided into
3 parts: browser objects, language objects, and form field objects.
Answer: True
BACK
Question # 52 (Multiple Choice) Form text field validation ________.
Answer: (B) can check if the field is empty
BACK
Question # 53 (Multiple Choice) Which of the following bitwise operators returns
a one in a bit if bits of either operand is one?
Answer: (C) |
BACK
Question # 54 (Multiple Choice) Which of the following is used to display text
in a browser window using Javascript?
Answer: (D) document.write("Hello, World!")
BACK
Question # 55 (Multiple Choice) The following code ________ when the user clicks
the button.
<form>
<p><font face="MS Sans Serif"><input TYPE="Button" VALUE="Back up"
onClick="history.go(-1);"> </font></p>
</form>
Answer: (A) goes back one page
BACK
You can buy the full version of this test for $15 for 110 questions by clicking
on the PayPal link. If you need to pay by some other means, go to the payment
page for other instructions.
It is much more cost efficient to JOIN CIW Study Site for $29.95. After joining,
members have access to over 1200 questions in the Designer, Developer and Server
Administrator tracks. You also get additional study materials.
26
JAVA SCRIPT
Question # 1 (Multiple Choice) Which of the following comparison operators
returns true if the operands are not equal?
A) &&
B) ==
C) !=
D) @
Question # 2 (Multiple Choice) Which of the following is the most commonly used
Javascript version?
A) 1.2
B) 1.3
C) 1.4
D) 1.5
Question # 3 (Multiple Choice) ________ relates the principal that some objects
cannot be used or referenced without referring to the parent, or container,
object.
A) Containership
B) Inheritance
C) SOM
D) DOME
Question # 5 (Multiple Answer) Which of the following let you jump out of an
iterating loop?
A) abort
B) Q
C) break
D) continue
Question # 8 (Multiple Answer) Which of the following are proper variable names?
A) default
B) _first Text
C) firstText
D) 1stText
E) _var
Question # 18 (Multiple Choice) ________ are the actions that the object
property can be made to perform, such as calculation or writing of text.
A) Functions
B) Event handlers
C) Methods
D) Operations
Correct Answers
1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 ,
19 , 20
Question # 1 (Multiple Choice) Which of the following comparison operators
returns true if the operands are not equal?
Answer: (C) !=
BACK
29
JAVA SCRIPT
Question # 2 (Multiple Choice) Which of the following is the most commonly used
Javascript version?
Answer: (A) 1.2
BACK
Question # 3 (Multiple Choice) ________ relates the principal that some objects
cannot be used or referenced without referring to the parent, or container,
object.
Answer: (A) Containership
BACK
Question # 4 (Multiple Choice) In the following code, line number ______
contains the name of the function and the argument num that we will pass when we
call the function.
1. function rollOn(num){
2. if(document.images){
3. eval('document.images["norm'+num+'"].src
4. ='+'over[num].src')}
5. }
Answer: (A) 1
BACK
Question # 5 (Multiple Answer) Which of the following let you jump out of an
iterating loop?
(C) break
(D) continue
BACK
Question # 6 (Multiple Choice) Functions are best described as a ________.
Answer: (C) series of commands
BACK
Question # 7 (Multiple Choice) Which of the following logical operators returns
true if either logical expression is true?
Answer: (C) ||
BACK
Question # 8 (Multiple Answer) Which of the following are proper variable names?
(C) firstText
(E) _var
BACK
Question # 9 (Multiple Choice) Javascript's original name was ________.
Answer: (C) livescript
BACK
Question # 10 (Multiple Choice) Which of the following bitwise operators flips
the bits of its operand?
Answer: (A) ~
BACK
Question # 11 (Multiple Choice) Which of the following is a method?
Answer: (D) prompt()
BACK
Question # 12 (Multiple Choice) Variables are declared in Javascript using which
of the following?
Answer: (B) var
BACK
30
JAVA SCRIPT
Question # 13 (Multiple Choice) Which of the following is used to insert a
backspace?
Answer: (A) \backspace
BACK
Question # 14 (Multiple Answer) Which of the following should be avoided in
Javascript for increased accessibility by the disabled?
(A) onMouseover
BACK
Question # 15 (Multiple Choice) What is Javascript's default object?
Answer: (C) window
BACK
Question # 16 (Multiple Choice) Which of the following syntax is correct for
commenting multiple lines in Javascript?
Answer: (B) /* Comments */
BACK
Question # 17 (Multiple Answer) Which of the following bitwise operations are
correct?
(B) 15&9 yields 9
BACK
Question # 18 (Multiple Choice) ________ are the actions that the object
property can be made to perform, such as calculation or writing of text.
Answer: (C) Methods
BACK
Question # 19 (Multiple Choice) Which of the following is used to insert a new
line?
Answer: (B) \n
BACK
Question # 20 (Multiple Choice) The following _________.
function confirm(){if (confirm("Do you hold us harmless from all legal action?
"))
location="http://www.xxx.com";return " "}
document.writeln(confirm())
31