wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

What will this code display?

a)

Hello Emma

b)

Hello user

c)

Hello+user

d)

nothing

2.

What will this code display?

a)

570

b)

569

c)

568

d)

attendees

3.

To declare a JavaScript variable, you should NOT use?

a)

Let

b)

Var

c)

Const

d)

Int

4.

Where JavaScript available in?

a)

Opera

b)

Microsoft Edge

c)

Microsoft Word

d)

Safari

5.

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");

6.

JavaScript : What is the alert display for text3 ?

a)

John Doe

b)

JohnDoe

c)

"John" " " "Doe"

d)

"JohnDoe"

7.

JavaScript : What is the alert display for z?

a)

Hello5

b)

10

c)

55

d)

Hello15

8.

What is the value of:

”41” + 1

a)

42

b)

“42”

c)

411

d)

“411”

9.
Which 1 of the following symbols is used for JavaScript comments?
a)
\\
b)
^
c)
?
d)
//
10.

How can a developer show a pop-up message to the user?

a)

alert

b)

prompt

c)

console.log

d)

<p> tag

11.
Which message will the user see?
a)
"Hello user"
b)
No message
c)
"Goodbye user"
d)
"message + user"
12.
How do I declare a new variable?
a)
var newVariable = 5;
b)
Variable int = new Variable();
c)
var 5 = myVariable;
d)
int var = 5;
13.

A store has 20 apples in its inventory. How can you store this information in a JavaScript variable?

a)

var numApples == 20;

b)

20 = numApples;

c)

var numApples = 20;

d)

var num apples = 20;

14.
A string;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
15.
A boolean;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
16.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
17.

What would this piece of code display?

let x = 5;

console.log(x != 8);

a)

false

b)

x!=8

c)

true

d)

8

18.

To declare a JavaScript variable, you should NOT use?

a)

Let

b)

Var

c)

Const

d)

Int

19.

What does HTML stand for?

a)

The builder

b)

Hyper text markup language

c)

Hyper text material language

d)

hyper text transfer protocol

20.

What does CSS stand for?

a)

The artist

b)

Cascading style sheets

c)

Cascade story scene

21.

What are the 3 languages used with website coding?

a)

HTML, HTTP,,code

b)

HTML, CSS, Javascript

c)

words, pictures and graphics

d)

CSS, text hypertext