wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Code.Org JavaScript

Total questions: 30

Worksheet time: 17mins

Name
Class
Date
1.
Which command colors the background of your canvas?
a)
background 
b)
endShape
c)
var = color
d)
fill
2.
What command draws a rectangle?
a)
rec (10, 20, 100, 200);
b)
rect (10, 20, 100, 200)
c)
rect (10, 20, 100, 200);
d)
ellipse (10, 20, 40, 40)
3.
What command removes the outlines from shapes?
a)
noOutline ();
b)
noColor();
c)
noBorder();
d)
noStroke ();
4.
What command colors a shape?
a)
color (43, 255, 0);
b)
bucket (43, 255, 0);
c)
fill (43, 255, 0);
d)
bucket (43, 255, 0);
5.
What command draws a line?
a)
stroke (200, 220, 275, 220);
b)
line (200, 220, 275, 220);
c)
horizontal (200, 220,  60, 75);
d)
pencil (200, 220, 275, 220);
6.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
7.
After running the following code, what will be the value of x?
y = 3;
x = 5 * y;
a)
3
b)
5
c)
15
d)
0
8.
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
9.
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
10.
The following code will:
var xPos = 15;
var yPos = 350;
var xwidth = 50;
var ywidth = 50;
draw = function() {   
     background(29, 40, 115);   
     fill(255, 242, 0);   
     ellipse(xPos, yPos, xwidth, ywidth);              xPos++;   
     yPos--;   
     xwidth = xwidth* 99/100;   
     ywidth = ywidth * 99/100;
};
a)
Draw a circle that moves right to left accross the screen, getting smaller
b)
Draw a circle that moves diagonally accross the screen, getting bigger
c)
Draw a circle that moves diagonally accross the screen, getting smaller
d)
Draw a circle that moves right to left accross the screen, getting bigger
11.
A string is used for storing:
a)
Numbers
b)
Integers
c)
Images
d)
Text
12.
To insert a JavaScript into an HTML page, use the _________ tag.
a)
<java>
b)
<jvcrb>
c)
<script>
d)
<jscript>
13.
Scripts can be placed in the________, or in the _____ section of an HTML page, or in both.
a)
 <body>, <head>
b)
<html>, <head>
c)
<body> <script>
d)
<html>, <script>
14.
JavaScript files have the file extension ______.
a)
.jsc
b)
.scj
c)
.js
d)
.html
15.
In a programming language, __________ are used to store data values.
a)
tags
b)
codes
c)
files
d)
variables
16.
JavaScript uses the _______ keyword to define variables.
a)
vrb
b)
var
c)
vari
d)
va
17.
JavaScript variables can hold ______ like 100, and _____ (text) values like "Mehmet Akif".
a)
measurements and names
b)
values and  objects
c)
numbers and string
d)
decimal and letters 
18.
_______ can execute a block of code as long as a specified condition is true.
a)
Loops
b)
Circles
c)
Variables
d)
Javascript
19.
The __________ is a worldwide network of computer systems through which information can be easily shared.
a)
www
b)
network
c)
computer
d)
Internet
20.
To view information through the World Wide Web, the end user must have a type of software application called a __________ which is installed on a computer that is connected to the Internet.
a)
hardware
b)
browser
c)
server
d)
system aplication
21.
A ________ is composed of many files that are located on a _________.
a)
application , computer
b)
software , local discs
c)
page, storage device
d)
website , web server
22.
The URL is also called a web page _______ or a website _________ .
a)
address , address
b)
address , view
c)
address , entrance
d)
direction , address
23.
IP address stands for __________. 
a)
Interview Protocol address
b)
Internet Protocol address
c)
Interchange Protocol address
d)
Internal Protocol address
24.
The image file type must be _________ .
a)
.gif, .jpg, or .png
b)
.gif
c)
 .jpg
d)
.png
25.
WYSIWYG stands for _________________________________ .
a)
Way you see is what you go
b)
What you see is what you get
26.
A JavaScript function is defined with the________  keyword, followed by a ________ , followed by __________ .
a)
variable, name, {}
b)
strings, value, <>
c)
function, name, parentheses ()
d)
values, address, ""
27.

This script will show as a result:

<html>

<head> <script>

alert("Hello World !");

</script></head>

<body>

</body>

</html>

a)

Hello World !

b)

Hello

c)

Hello World

d)

World !

28.

To use an external script, put the name of the script file in the src (source)

attribute of the ___________ tag:

a)

<java>

b)

<scr>

c)

<script>

d)

<html>

29.

Complete the gaps: In a programming language, variables are used to store data values. JavaScript uses the ____1____ keyword to define variables.

JavaScript ____2_____ can hold ___3____ like 100, and ___4___ (text) values like "Henri Tusku".

a)

1.variables , 2.var , 3.numbers , 4.string

b)

1.string , 2.numbers , 3.var , 4.variables

c)

1.var, 2.variables , 3.numbers , 4.string

d)

1.string , 2.numbers , 3.var , 4.var

30.

_______________________________can contain letters, digits, underscores, and dollar signs (same rules as variables).

a)

Variables

b)

Java Script

c)

Code

d)

Function names