Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JRDL - JS Variables, Datatypes, and Operators

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

How do you declare a variable?

a)

var = firstName = ' jane';

b)

var firstName = 'jane';

c)

var 'firstName' = jane;

d)

var firstName == 'jane';

2.

What data types have you learned so far?

a)

text, integer, true, false

b)

string, number, boolean

c)

boolean, characters, undefined

d)

text, number, true, false

3.

What will the following code evaluate to?


"cat" === "Cat"

a)

false

b)

true

4.

What does the strict equality operator look like?

a)

==

b)

====

c)

===

d)

=

5.

What will the following code evaluate to?


'610' !== 610

a)

false

b)

true

6.

What will the following code evaluate to?


'87' !== '87'

a)

false

b)

true

7.

What is the final result of number?


var number = 99;

number--;

number--;

number++;

number--;

number--;

number++;

a)

96

b)

97

c)

98

d)

100

8.

What will the following code console log?


var favFood = 'pizza';

console.log('favFood');

a)

'pizza'

b)

pizza

c)

'favFood'

d)

none of the above

9.

What is the assignment operator?

a)

===

b)

=

c)

==

d)

+

10.

When declaring a variable what comes after the reserved word var?

a)

the variable name

b)

the assignment operator

c)

the value

d)

none of the above

11.

What is the final value of name?


var name = 'mel';

name = undefined;

name = 'jay';

name = 'grumpy cat';

a)

'jay'

b)

'mel'

c)

undefined

d)

'grumpy cat'

12.

What will the following code evaluate to?


100 >= 99

a)

false

b)

true

13.

What is the main purpose of JavaScript?

a)

Functionality

b)

Styling

c)

Structure

d)

Nothing