wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Khan Academy JavaScript

Total questions: 12

Worksheet time: 4mins

Name
Class
Date
1.

Which of these lines of JS code are syntactically correct?

a)

rect(100, 100, 50, 50);

b)

rect(100 100 50 50);

c)

rect[100, 100, 50, 50];

d)

rect(100, 100, 50, 50):

2.

Which is the correct way to write a comment in JavaScript?

a)

(#...#)

b)

(!...!)

c)

{{.....}}

d)

//....

3.

Which of these lines of JS code are syntactically correct?

a)

rect100, 100, 50, 50

b)

rect(100 100 50 50);

c)

rect(100, 100, 50, 50);

d)

rect(100, 100, 50, 50):

4.

You want to draw a circle, which command is written correctly?

a)

//circle

b)

circle();

c)

ellipse();

d)

//ellipse

5.

In the following line of code - rect(200, 150, 50, 120); What does the last number (120) stand for?

a)

X

b)

Y

c)

W

d)

H

6.

In the following line of code - rect(200, 150, 50, 120); What does the first number (200) stand for?

a)

X

b)

Y

c)

W

d)

H

7.

In the following line of code - rect(200, 150, 50, 120); What does the 3rd number(50) stand for?

a)

X

b)

Y

c)

W

d)

H

8.

When adding a background color which is the correct line of code?

a)

bg(200, 0, 0);

b)

background(200, 0, 0);

c)

bckgr(200, 0, 0);

d)

backgnd(200, 0, 0);

9.

RGB stands for what?

a)

REAL GOOD BASICS

b)

RED GREEN BLUE

c)

REFERENCE GOOD BACKGROUNDS

d)

RECTANGLE GOING BLUE

10.

If I want to add a variable for my eyes, which would be the correct line of code.

a)

var eyeSize;

b)

variable = eyeSize!

c)

variable (eyeSize)

d)

var = eyeSize

11.

The "X" parameter

a)

Moves the object left and right

b)

moves the object up and down

c)

changes the width

d)

changes the height

12.

The "Y" parameter

a)

moves the object left and right

b)

moves the object up and down

c)

makes the object wider or thinner

d)

makes the object taller or shorter