Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript Midterm Review

Total questions: 27

Worksheet time: 14mins

Name
Class
Date
1.

Which one of the following symbols is used for JavaScript comments?

a)

\\

b)

^

c)

;

d)

//

2.

Which command draws a rectangle?

a)

rec (10, 20, 100, 200);

b)

rect (10, 20, 100, 200);

c)

rect (10, 20);

d)

ellispse (10, 20, 40, 40)

3.

Which command colors the background of your canvas?

a)

background

b)

var = color

c)

endShape

d)

fill

4.

Which command removes the outlines from shapes?

a)

noOutline();

b)

noBorder();

c)

noColor();

d)

noStroke();

5.

What command draws a perfect circle?

a)

ellispse (80, 60, 100, 105);

b)

ellipse (80, 60, 100, 100);

c)

circle (80, 60, 80, 60);

d)

ellipse (80, 60, 105, 100);

6.

What command colors a shape?

a)

color (43, 255, 0);

b)

fill (43, 255, 0);

c)

bucket (43, 255, 0);

d)

bucketFill (43, 255, 0);

7.

What is at the end of a line of code?

a)

#

b)

;

c)

,

d)

"

8.

The "stroke" command means

a)

The "stroke" command means

b)

color outside a shape

c)

color of blocks

d)

border

9.

What does the "fill" command do?

a)

put letters in the shape

b)

put pictures in the shape

c)

put color in the shape

d)

put code in the shape

10.

A variable is used to

a)

store a value in memory

b)

draw a circle

c)

store a value that does not change

d)

draw a rectangle

11.

JavaScript uses the keyword ___ to define variables.

a)

vrb

b)

var

c)

vari

d)

va

12.

What is JavaScript?

a)

a programming language

b)

HTML tags

c)

an alphabet

d)

an alphabet

13.

Color values range from

a)

0-255

b)

10-200

c)

0-355

d)

0-200

14.

To fill a shape with the color white you would use which code?

a)

fill ( 255, 255, 255);

b)

background (255, 255, 255);

c)

fill (0, 0, 0);

d)

fill (255, 255, 255, 255);

15.

Which command would you use to change the thickness of a line?

a)

strokeWeight

b)

noStroke

c)

borderWeight

d)

stroke

16.

To fill a shape with the color black you would use which code?

a)

color (255, 255, 255);

b)

fill (255, 255, 255);

c)

fill (0, 0, 0);

d)

fill (0, 0, 0)

17.

In a fill command, the colors of the parameters in order are:

a)

r, b, g

b)

r, r, g

c)

b, g, r

d)

r, g, b

18.

The command var stands for ___.

a)

variation

b)

variable

c)

varizon

d)

very special

19.

If I wanted to draw an oval, I would use the ___ command.

a)

oval

b)

circle

c)

ellipse

d)

ell

20.

If I wanted to draw a square, I would use the ____ command.

a)

squ

b)

ellipse

c)

square

d)

rect

21.

If I want my line to be thicker, I would use the ___ command.

a)

strokeWeight

b)

noStroke

c)

strokeThick

d)

lineWeight

22.

The numbers in the parentheses of a command are called ___.

a)

parameters

b)

numbers

c)

codes

d)

partners

23.
a)

rect(175, 175, 50, 50)

b)

rect(100, 350, 20, 50);

c)

rect(175, 175, 50, 50);

d)

rect(50, 350, 20, 50);

24.
a)

ellipse(80, 150, 90, 170);

b)

ellipse(150, 80, 90, 170);

c)

ellipse(80, 150, 20, 20);

d)

ellipse(150, 80, 50, 50);

25.

Which is a shortcut for x = x + 1?

a)

++ x

b)

x ++ 11

c)

x == 1

d)

x++

26.

Which is a shortcut for x = x + 1?

a)

x =+

b)

x ++=

c)

x += 1

d)

x +=+ 1

27.

When you use a draw function, where do you have to assign the variables?

a)

BEFORE the function

b)

IN the function

c)

AFTER the function