wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JS quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Is JavaScript a programming language

a)

True

b)

False

2.

What does var stand for in JavaScript?

a)

Value

b)

Variable

c)

Variant

d)

Varying

3.

Which symbol is used for comments in JavaScript?

a)

<!-- -->

b)

//

c)

**

d)

/# #/

4.

How do you write a function in JavaScript?

a)

def myFunc()

b)

function: myFunc()

c)

function myFunc() {}

d)

func myFunc()

5.

Which of these is not a JavaScript data type?

a)

string

b)

number

c)

boolean

d)

float

6.

Which method is used to print something to the console?

a)

printf()

b)

echo()

c)

console.log()

d)

log.console()

7.

Who developed JavaScript?

a)

Dennis Ritchie

b)

Uday Adhikari

c)

Bjarne Stroustrup

d)

Brendan Eich

8.

What keyword is used to declare a constant in JavaScript?

a)

var

b)

const

c)

let

d)

static

9.

JavaScript runs in which environment by default?

a)

Browser

b)

Server

c)

Terminal

d)

Computer

10.

Which tag is used to add JavaScript in an HTML file?

a)

<script>

b)

<link>

c)

<js>

d)

<javascript>

11.

JavaScript is a...

a)

Compiled language

b)

Markup language

c)

Scripting language

d)

Database language

12.

Which of the following can store multiple values?

a)

int

b)

bool

c)

char

d)

array

13.

How do you show a popup message in JavaScript?

a)

popup("Hello")

b)

alert("Hello")

c)

message("Hello")

d)

show("Hello")

14.

Which of these is a correct variable name?

a)

123name

b)

@name

c)

name-123

d)

name_123

15.

What does console.log("Hi") do?

a)

Prints in alert box

b)

Prints on the webpage

c)

Prints in the browser console

d)

Doesn't do anything

16.

What does + do when used with strings?

a)

What does + do when used with strings?

b)

Adds numbers inside

c)

Joins (concatenates) them

d)

Returns an error

17.

JavaScript file extension is:

a)

.js

b)

.java

c)

.javascript

d)

.jvs

18.

Which of these is a number in JavaScript?

a)

five

b)

"5"

c)

"five"

d)

5

19.

Which keyword is used to define a function in JavaScript?

a)

define

b)

function

c)

procedure

d)

method

20.

Java and Javascript are related.

a)

True

b)

False