wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

javascript

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What type of variable is apple?

var apple = " Fuji "

a)

string

b)

Boolean

c)

array

d)

number

2.

What type of variable is quantites?

var quantities = [2, 4, 10, 1]

a)

string

b)

Boolean

c)

array

d)

number

3.

What is first index value of an array?

a)

2

b)

-1

c)

0

d)

1

4.

What is the value of “a” in the following statement?

var a;

a)

undefined

b)

null

c)

0

d)

NaN

5.

What is the value of:

”41” + 1

a)

42

b)

“42”

c)

411

d)

“411”

6.

What is the value of:

”31” - 1

a)

“30”

b)

30

c)

“311”

d)

NaN

7.

What is the extension for a JavaScript file?

a)

.java

b)

.jar

c)

.js

d)

.sj

8.

JavaScript functions can access variables defined in the same scope?

a)

True

b)

False

9.

Variables defined inside of functions are accessible outside of the function?

a)

True

b)

False

10.

What is the name of the JavaScript standard?

a)

JavaScript

b)

ECMA Script

c)

JS

d)

PEP

11.

In JavaScript strings must be defined using only double quotes (“).

a)

True

b)

False

12.

Which list contains the correct data types in JavaScript?

a)

numbers, strings, booleans, symbols, objects, null, and undefined

b)

numbers, strings, booleans, symbols, objects, Nan, and undefined

c)

numbers, strings, booleans, symbols, objects, null, and undefined

d)

numbers, strings, booleans, symbols, objects, null

13.

What will this code display?

a)

8, 2, 1, 4, 7

b)

82147

c)

Myarray.length

d)

5

14.

What will this code display?

a)

570

b)

569

c)

568

d)

attendees

15.

Which of these is a method?

a)

getElementById( )

b)

style

c)

document

d)

color