wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript Variables

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

To declare a JavaScript variable, you should NOT use?

a)

Let

b)

Var

c)

Const

d)

Int

2.

When to use JavaScript var?

a)

JS code from 1995 to 2015

b)

JS code in 2015

c)

Older browser

d)

Any JS code

3.

What is the output for this code?

a)

The value of z is z

b)

The value of z is 11

c)

The value of z is: 11

d)

The value of z is: x + y

4.

What are variables? Choose two from the answers.

a)

container for storing data

b)

storing data values

c)

A cupboard

d)

hold a water in it

5.

What is the value of x?

a)

3

b)

83

c)

80

d)

803

6.

JavaScript is a flexible programming language.

a)

I don't know

b)

Yes

c)

No

d)

Maybe

7.

JavaScript is removing the interactivity of a browser.

a)

I don't know

b)

Yes

c)

No

d)

Maybe

8.

Where JavaScript available in?

a)

Opera

b)

Microsoft Edge

c)

Microsoft Word

d)

Safari

9.

Inside which HTML element do we put the JavaScript

a)

<scripting>

b)

<script>

c)

<js>

d)

<javascript>

10.

where id the correct place to insert a JavaScript?

a)

<body>

b)

<head>

c)

<body>, <head>

d)

html

11.

How do you write "Hello World" in an alert box?

a)

msg("Hello World");

b)

alertBox("Hello World");

c)

alert("Hello World");

d)

msgBox("Hello World");

12.

If I want to change the mathematical expression from addition into division, what symbol should I use?

a)

/

b)

*

c)

-

d)

x

13.

If I want to change the mathematical expression from addition into multiplication, what symbol should I use?

a)

/

b)

*

c)

-

d)

x