wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

quiz 1

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

Question 1: Which of the following is not a JavaScript data type?

a)

a) String

b)

b) Array

c)

c) Float

d)

d) Function

2.

Question 2: What is the correct data type for the value "42"?

a)

a) Number

b)

b) String

c)

c) Boolean

d)

d) Undefined

3.

Question 3: What will the following expression evaluate to?

typeof "Hello"

a)

a) "Number"

b)

d) "Undefined"

c)

c) "String"

d)

b) "Boolean"

4.

Question 4: How do you declare a variable in JavaScript?

a)

d) const myVariable;

b)

c) let myVariable;

c)

b) variable myVariable;

d)

a) var myVariable;

5.

Question 5: Which data type is used to store multiple values in a single variable?

a)

c) Boolean

b)

d) Array

c)

b) Number

d)

a) String

6.

Question 6: What will the following expression evaluate to?

typeof true

a)

a) "String"

b)

d) "Undefined"

c)

c) "Boolean"

d)

b) "Number"

7.

Question 7: How do you check if two variables have the same value and data type in JavaScript?

a)

a) Using the == operator

b)

b) Using the === operator

c)

c) Using the != operator

d)

d) Using the !== operator

8.

Question 8: What is the correct way to access the length of an String called "myStr" in JavaScript?

a)

a) length(myStr)

b)

d) myStr.length()

c)

c) myStr.length

d)

b) myStr.size

9.

Question 9: What will the following expression evaluate to?

typeof [1, 2, 3]

a)

a) "String"

b)

b) "Number"

c)

d) "Object"

d)

c) "Boolean"

10.

Question 10: How do you create a single-line comment in JavaScript?

a)

a) // This is a comment

b)

c) /* This is a comment */

c)

b) <!-- This is a comment -->

d)

d) # This is a comment