wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SkillDojo <> JavaScript Mondays

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

Which of the following can't be done with

client-side JavaScript?

a)

Validating a form

b)

Sending a form's contents by email

c)

Storing the form's contents to a database file on

the server

d)

None of the above

2.

Which of the following is the structure of an

if statement?

a)

if (conditional expression is true)

thenexecute this codeend if

b)

if (conditional expression is true)execute this

codeend if

c)

if (conditional expression is true)

{then execute this code>->}

d)

if (conditional expression is true) then {execute

this code}

3.

How to create a Date object in JavaScript?

a)

dateObjectName = new Date([parameters])

b)

dateObjectName.new Date([parameters])

c)

dateObjectName := new Date([parameters])

d)

dateObjectName Date([parameters])

4.

The _______ method of an Array object adds and/or

removes elements from an array.

a)

Reverse

b)

Shift

c)

Slice

d)

Splice

5.

To set up the window to capture all Click events,

we use which of the following statement?

a)

window.captureEvents(Event.CLICK);

b)

window.handleEvents (Event.CLICK);

c)

window.routeEvents(Event.CLICK );

d)

window.raiseEvents(Event.CLICK );

6.

Which of the following is not a reserved word in

JavaScript?

a)

interface

b)

throws

c)

program

d)

short

7.

To automatically open the console when a JavaScript

error occurs which of the following is added to prefs.js?

a)

user_pref("

javascript.console.open_on_error", false);

b)

user_pref("javascript.console.open_error");

c)

user_pref("javascript.console.open_error

", false);

d)

user_pref("javascript.console.open_on_error",

true);

8.

What is mean by "this" keyword in javascript?

a)

It refers current object

b)

It referes previous object

c)

It is variable which contains value

d)

None of the above

9.

Which types of image maps can be used with JavaScript?

a)

Server-side image maps

b)

Client-side image maps

c)

Server-side image maps and Client-side image maps

d)

None of the above

10.

Which is the correct way to write a JavaScript array?

a)

var txt = new

Array(1:"tim",2:"kim",3:"jim")

b)

var txt = new

Array:1=("tim")2=("kim")3=("jim")

c)

var txt = new

Array("tim","kim","jim")

d)

var txt = new

Array="tim","kim","jim"

11.

What does the <noscript> tag do?

a)

Enclose text to be displayed by non-JavaScript

browsers.

b)

Prevents scripts on the page from executing.

c)

Describes certain low-budget movies.

d)

None of the above

12.

If para1 is the DOM object for a paragraph, what is

the correct syntax to change the text within the paragraph?

a)

"New Text"?

b)

para1.value="New Text";

c)

para1.firstChild.nodeValue= "New

Text";

d)

para1.nodeValue="New Text";

13.

JavaScript entities start with _______ and end with

_________.

a)

Semicolon, colon

b)

Semicolon, Ampersand

c)

Ampersand, colon

d)

Ampersand, semicolon

14.

Which of the following way can be used to indicate

the LANGUAGE attribute?

a)

<LANGUAGE="JavaScriptVersion">

b)

<SCRIPT

LANGUAGE="JavaScriptVersion">

c)

<SCRIPT

LANGUAGE="JavaScriptVersion"> JavaScript

statements…</SCRIPT>

d)

<SCRIPT

LANGUAGE="JavaScriptVersion"!> JavaScript

statements…<SCRIPT>

15.

Inside which HTML element do we put the

JavaScript?

a)

<js>

b)

<scripting>

c)

<script>

d)

<javascript>

16.

What is the correct syntax for referring to an

external script called " abc.js"?

a)

<script href=" abc.js">

b)

<script name=" abc.js">

c)

<script src=" abc.js">

d)

None of the above

17.

__________ JavaScript is also called

server-side JavaScript.

a)

Microsoft

b)

Navigator

c)

LiveWire

d)

Native

18.
A string;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
19.
To display writing on the screen you must include this direction;
a)
Document Write
b)
documentWrite
c)
document.write( )
d)
document.write
20.

What is the value of:

”41” + 1

a)

42

b)

“42”

c)

411

d)

“411”

21.

What other languages are typically used with JavaScript?

a)

Python

b)

Ruby

c)

HTML & CSS

d)

SQL

22.

What is the difference between var and let in JavaScript?

a)

There are no differences, they are both the same.

b)

let is visible through blocks and accessed globally, var isn't.

c)

var is visible through blocks and accessed globally, let isn't.

d)

let is used more frequently, var isn't.