Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

uCertify JavaScript Chapter 6 Test

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the one property associated with the history object? (Remember a property is different than an object)

a)

forward

b)

length

c)

go

d)

back

2.

Which line of code will allow you to redirect the browser to the page which he was previously viewing?

a)

history.forward();

b)

history.back();

c)

history.backward();

d)

history.go(1);

3.

What is the purpose of the location object? (This is different than geolocation.)

a)

To get the geographical location of a user

b)

To get the location of a user in the network

c)

To specify URLs in the script

d)

To identify an area in a Web page

4.

Which JavaScript object allows you to access previously visited Web page URLs?

a)

Location

b)

Document

c)

Navigator

d)

History

5.

What is the purpose of the navigator object? (this is different than navigating the web-site)

a)

To allow navigation in the Web page

b)

To allow navigation to some other page

c)

To relay information about the web server being accessed

d)

To relay information about the web browser being used

6.

What is the default object in JavaScript? (contains scroll bars, navigation bars, menu bars, and so forth)

a)

Document

b)

Location

c)

Navigator

d)

Window

7.

You have opened a window to http://www.myweb.com/faq/answers.htm?protocol=email.


Consider the following alert:


alert(location.protocol);


What will this alert display if added to the code of your document?


**Remember what the location object does**

a)

protocol=email

b)

www

c)

http:

d)

email

8.

Which JavaScript object represents the frame of the browser and the mechanisms associated with it?

a)

Navigator

b)

Window

c)

Document

d)

Image

9.

Which of the following is the container of the form object?

a)

Window

b)

Document

c)

Array

d)

Navigator

10.

How many arguments does the generic syntax for the window.open() method use?

a)

One

b)

Five

c)

Seven

d)

Three

11.

Which code will display an alert if the variable timerMinutes has a value 10?

a)

if (timerMinutes == 10) alert("Time Expired!");

b)

if ("timerMinutes" = 10) {

alert("Time Expired!");

}

c)

if ("timerMinutes" == 10); {

alert("Time Expired!");

}

d)

if ("timerMinutes" = 10) alert("Time Expired!");

12.

What is the purpose of the switch statement?

a)

To force the flow of control back to the top of a loop

b)

To exit a loop that would otherwise continue to execute

c)

To repeat a group of statements for some particular range of values

d)

To compare a value against other values, to search for a match

13.

Which JavaScript statement should you use to test for a single condition and branch to a process?

a)

if

b)

for

c)

if...else

d)

while

14.

What is the purpose of the while statement?

a)

To execute a block of code for as long as a condition is true

b)

To delay execution of a block of code for as long as a condition is true

c)

To delay execution of a block of code until a condition is true

d)

To execute a block of code until a condition is true

15.

Consider the following code snippet:


var x = 100;

while (x > 5) {

x--;

}


What will be the value of x after the execution of the given code snippet?

a)

5

b)

4

c)

6

d)

100