wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Javascript basics

Total questions: 15

Worksheet time: 17mins

Name
Class
Date
1.

What type of variable is expressed as true/false?

a)

String

b)

Boolean

c)

Number

d)

Conditional

2.

A variable can be declared with keyword (a)  

3.

What operator can be used with both strings and numbers?

a)

"-"

b)

"/"

c)

"+"

d)

"*"

4.

What is the result of 12 % 512\ \%\ 5  ?

a)

2

b)

17

c)

60

d)

7

5.

Which of these is NOT a valid string?

a)

Hello

b)

"work4$"

c)

"Hello, world!"

d)

"dude'

6.

What is the difference between loose equality (==) and strict equality (===)?

4 lines
7.

What will be logged to the console here? --

var concatted = 5 + 7 + "hello" + 5 + 12

a)

57hello512

b)

12hello17

c)

12hello512

d)

57hello17

8.

What will this boolean expression resolve to? --

"23" < "123"

a)

true

b)

false

9.

Which of these characters CAN be included in a number?

a)

7

b)

.

c)

,

d)

-

10.

How can the modulo operator be useful?

4 lines
11.

Which of these characters can be included in a string?

a)

Alphabetical (a-z, A-Z)

b)

Digits (0-9)

c)

Spaces

d)

Special Characters (!/$^*, etc.)

e)

all of the above

12.
What surrounds a string?
a)

Quotations:

" " or ' '

b)

Curly Brackets:

{ }

c)

Parentheses:

( )

d)

Square Brackets:

[ ]

13.

In this code snippet:

```

var thing;

console.log(thing);

```

What is the value of "thing"?

a)

null

b)

"thing"

c)

undefined

d)

""

14.

What will this return?

`typeof 34.5`

(a)  

15.

What is one difference between Javascript and Java?

4 lines