wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Script Pro

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

What is Javascript used for?

a)

Behaviour

b)

Presentation

c)

Structure

2.

var x = 5;

var y = 2;

var z = x % y;


What would be the value of "z" in the above code?

a)

1

b)

2

c)

0

3.

An "ID" can be a word or a number.

a)

True

b)

False

4.

Which of the following is not JavaScript Data Types?

a)

Undefined

b)

Number

c)

Boolean

d)

Float

5.

Choose the codes that allow you to write into a <p> or a <h1>.

a)

document.getElementById

b)

document.write

c)

alert

6.
Which command colors the background of your canvas?
a)
background 
b)
endShape
c)
var = color
d)
fill
7.
The command: ellipse( 200,100, 20, 20) will draw:
a)
an ellipse that is 100 pixels wide and 100 pixels high
b)
a circle whose center is 200 pixels across and 100 pixels down
c)
a rectangle that is 200 pixels by 100 pixels wide
d)
a circle that is 200 pixels in diameter
8.
What command removes the outlines from shapes?
a)
noOutline ();
b)
noColor();
c)
noBorder();
d)
noStroke ();
9.

Which of these is a loop?

a)

if(x<10)

b)

while(x<10)

c)

var x=10;

10.

What is the code used to allow user input as a value to a variable in JavaScript?

a)

Prompt

b)

Input

c)

==