Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

GMetrix Session 2 JavaScript Exam

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

An undefined variable is an empty variable that has been declared, but has never had a value. This is does not have: a number, a Boolean value, and a ________

a)

string value

b)

a letter

c)

a symbol

d)

a pet cat

2.

Variables do not need to be converted, whereas objects in JavaScript need to be converted before they can be used in a calculation

a)

True

b)

False

3.

In JavaScript, a declaration is the act of creating a new variable. What defines the initialization process?

a)

Storing an object

b)

Creating an object

c)

Storing a value in a variable

d)

initialing an object

4.

Which is an example of a sorting statement used to sort an array in JavaScript? (check the syntax!)

a)

sort.array();

b)

tuningList.sort();

c)

sort();

d)

tuningArray.sort

5.

The Math.abs method in JavaScript is used to perform which function? (check w3schools)

a)

Create an absolute value

b)

Make a variable an absolute value

c)

create a variable with an absolute value

d)

Make a number represent absolute value

6.

A keyword declared without a var keyword is considered to be which type of variable?

a)

Local

b)

Implicit

c)

Global

d)

Explicit

7.

document.write(incMsg);

Strings can be used to store text, numbers, and other characters. Is the above code an example of a string variable?

a)

Yes

b)

No

8.

An array in JavaScript is a(n) ________ with multiple containers that holds multiple _______

a)

value; objects

b)

variable; values

c)

object; values

d)

cup; drinks

9.

Which is an example of a pop command using the JavaScript console?

a)

tuningList.pop();

b)

drinkDietCoke.pop

c)

.pop();

d)

pop();

10.

Which best defines the purpose of the floor method?

a)

Used to change numbers to the nearest lower whole number

b)

Used to change numbers to the nearest higher whole number

c)

Used to change numbers to the nearest lower integer

d)

Used to change numbers to the nearest higher integer

11.

The main purpose of a ________ is to create reusable code.

a)

function

b)

object

c)

property

d)

event

12.

if x = 5 and y = x then y=7, what sill x be?

(in this scenario, think of y = x as a boolean (true vs false)

a)

Null

b)

Undefined

c)

5

d)

7