wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript and HTML review

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

In JavaScript, what symbol is used to indicate the end of a statement?

a)

* asterisk symbol

b)

# hash tag symbol

c)

: colon symbol

d)

; semicolon symbol

2.

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

a)

alert

b)

prompt

c)

console.log

d)

<p> tag

3.
JavaScript uses the _______ keyword to define variables.
a)
vrb
b)
var
c)
vari
d)
va
4.

What is a variable

a)

Store values in containers so we can use them later.

b)

Store values in containers so we can use them never.

c)

Store values in containers so we can use them once.

d)

Store values in containers so we can't use them later.

5.
What best describes the function of a for loop?
a)
it loops through a block of code for a finite amount of times
b)
it looks for a loop in a block of code
c)
it loops through code only within a function
d)
it loops through a block of code forever
6.
The following code will:
x++;
a)
Add 1 to the previous value of x
b)
Add 1 to the previous value of y
c)
Subtract 1 from the previous value of x
d)
Give an error message
7.

Repeat something 10 times

a)

repeat 10

b)

for (var i=0; i<10; i++)

c)

repeat { } until 10;

d)

while (i = 10)

8.
What surrounds an if/else statement?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
9.
What surrounds an array?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
10.

What is an array?

a)

A tag element

b)

An index

c)

A sea creature

d)

ordered list of items like numbers, text, and more

11.

Which of the following is the correct syntax for making an array in javascript?

a)

variable myArray = ["hi","hello","hey"];

b)

var my array = ["hi,"hello","hey];

c)

var myArray = [hi,hello,hey];

d)

var myArray = ["hi","hello","hey"];

12.
Which keyword do we need to define a function?
a)
function
b)
method
c)
onclick
d)
functionName()
13.
A function;
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
14.

Which of the following is NOT a valid component of a function declaration?

a)

Function keyword

b)

Function name

c)

Pair of Square Braces

d)

Pair of Curly Braces

15.
<h> is
a)
Header Tag
b)
Headline Tag
c)
Half of a tag
d)
Closing header tag
16.
<p> is
a)
punctuation tag
b)
closing paragraph tag
c)
closing punctuation tag
d)
paragraph tag
17.
</p> is
a)
punctuation tag
b)
closing paragraph tag
c)
closing punctuation tag
d)
paragraph tag
18.
What character do we use for multiplication?
a)
#
b)
x
c)
*
d)
/
19.
What character do we use for division?
a)
#
b)
x
c)
*
d)
/
20.
What does HTML stand for?
a)
Hypertext Making Language
b)
Hyper Transfer Markup Language
c)
Hypertext Markup Language
d)
Hyper Transfer Making Language