wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JavaScript Cert Prep

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

In JavaScript, a logic error:

a)

is another term for a run-time error

b)

is another term for a syntax error

c)

is harder to troubleshoot because debuggers do not detect it

d)

can be detected and repaired automatically with an advanced debugger

2.

Watchpoints can assist a developer in troubleshooting

a)

run-time errors

b)

syntax errors

c)

logic errors

d)

browser errors

3.

What is the result of this code?


<script type="text/javascript"> function ClientMessage(){ var message = "Welcome!"; alert(message); } </script>

a)

When you enter the page, the alert box will display

b)

When you enter the page, you will be warned that there is unfinished JavaScript to run.

c)

The page will ignore the function, so a blank page will display on entry and exit.

d)

When you enter the page, there will be a JavaScript error because you cannot load an alert box.

4.

Which String object method can be used to test user input?

a)

The link() method

b)

The toLowCase() method

c)

The test() method

d)

The indexOf() method

5.

The JavaScript toUpperCase() method is an example of:

a)

a calling statement.

b)

an argument.

c)

a user-defined function

d)

a built-in function

6.

Which JavaScript statement should you use to execute a block of code for as long as a certain test condition is true, with the guarantee that the code block will execute at least once?

a)

if

b)

do

c)

if....else

d)

do...while

7.

Which of the following JavaScript code segments correctly accesses the user's entry in a text object named myTextBox in a form named myForm?

a)

var myVar;

myVar = document.myForm.myTextbox.text;

b)

var myVar;

myVar = document.myForm.myTextbox.input;

c)

var myVar;

myVar = document.myForm.myTextbox.value;

d)

var myVar;

myVar = document.myForm.myTextbox.content;

8.

Which database operation can AJAX perform when used with SQL, a server-side language and a database?

a)

Modify database security permissions, including changing the database owner

b)

Create custom database views and stored procedures

c)

Retrieve information from a database and display it back to the page originating the request

d)

Update the database schema and table relationships

9.

Which method is used to request and capture data from a user?

a)

The prompt() method

b)

The alert() method

c)

The open() method

d)

The confirm() method

10.

Which of the following code segments properly scripts a JavaScript for statement?

a)

for (var i = 0, i <= 10, i--) {

document.write("loop number " + i + "<br />");

}

b)

for (var i = 0; i >= 10; i++) {

document.write("loop number " + i + "<br />");

}

c)

for (var i = 0; i <= 10; i++) {

document.write("loop number " + i + "<br />");

}

d)

for (var i = 0, i >= 0, i--) {

document.write("loop number " + i + "<br />");

}