wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

G9-4.1JavaScript Basics Quiz

Total questions: 14

Worksheet time: 7mins

Name
Class
Date
1.

What is the primary purpose of JavaScript in web development?

a)

To create interactive content

b)

To structure web pages

c)

To style web pages

d)

To manage databases

2.

Which operator is used for addition in JavaScript?

a)

+

b)

/

c)

*

d)

-

3.

What is the correct way to declare a variable in JavaScript?

a)

let a = 10;

b)

int a = 10;

c)

declare a = 10;

d)

let a : 10;

4.

Which of the following is a primitive data type in JavaScript?

a)

Function

b)

String

c)

Object

d)

Array

5.

What does the console.log() function do?

a)

Shows output in a popup

b)

Displays output in an alert box

c)

Prints output to the console

d)

Writes output to a file

6.

What is the result of 2 ** 3 in JavaScript?

a)

9

b)

4

c)

8

d)

6

7.

Which operator is used to compare two values for equality in JavaScript?

a)

!=

b)

==

c)

===

d)

=

8.

What will be the output of the expression 5 == '5'?

a)

undefined

b)

NaN

c)

false

d)

true

9.

What is the purpose of the increment operator (++) in JavaScript?

a)

To assign a value

b)

To multiply a value by 2

c)

To increase a value by 1

d)

To decrease a value by 1

10.

Which of the following is NOT a comparison operator in JavaScript?

a)

==

b)

===

c)

++

d)

!==

11.

What will the expression 10 % 3 return?

a)

3

b)

1

c)

10

d)

0

12.

What is the output of console.log(typeof 'Hello')?

a)

object

b)

number

c)

undefined

d)

string

13.

Which of the following is a non-primitive data type in JavaScript?

a)

Boolean

b)

Array

c)

String

d)

Number

14.

What is the result of the expression (5 + 3) * 2?

a)

8

b)

16

c)

10

d)

12