Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript

Total questions: 20

Worksheet time: 10mins

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

14.

This is arithmetic operation for

a)

JavaScript

b)

JAVA

15.

Which programming language have this code for displaying output?

a)

JavaScript

b)

JAVA

16.

JavaScript : z should run x minus y. What operation should z use?

a)

-

b)

--

c)

-=

d)

%

17.

JavaScript : value of z should be the increment of y. What operation should z use?

a)

z = x ++ y

b)

z += y

c)

z = ++ y

d)

z = z + y

18.

JavaScript : What is the alert display for text3 ?

a)

John Doe

b)

JohnDoe

c)

"John" " " "Doe"

d)

"JohnDoe"

19.

JavaScript : What is the alert display for z?

a)

Hello5

b)

10

c)

55

d)

Hello15

20.

if z >= y

a)

if z less than or equal to y

b)

if z not equal to y

c)

if z greater than or equal to y

d)

if z greater than y