wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

More JavaScript Basics

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the proper function to call to print to the screen?

a)

write

b)

println

c)

PRINT

d)

post

2.

What is missing? (fill in the blank)

_____(var i = 0; i < 5; i++){

a)

if

b)

else

c)

for

d)

while

3.

In the code below, which increases by 1 after each iteration?

(var i = 2; i < 8; i++)

a)

i = 2

b)

i < 8

c)

i++

4.

Repeat something 10 times

a)

repeat 10

b)

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

c)

repeat { } until 10;

d)

while (i = 10)

5.

When we are done with a line what do we put at the end?

a)

a colon :

b)

a semi-colon ;

c)

a period .

d)

a quotation mark "

6.

When we surround a word with quotes "David" it's called ?

a)

a program

b)

a loop

c)

a string

d)

a command

7.

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.

8.

A short form writing the word variable is

a)

rav

b)

VAR

c)

var

d)

varia

9.

A short form writing the word variable is

a)

rav

b)

VAR

c)

var

d)

varia

10.

A programming language used for webpage functionality such as interactivity, data processing, animation, and development of purpose built apps such as mobile and desktop apps and more.

a)

HTML5

b)

CSS

c)

JS

d)

C#

11.

What function do you need to call to ask the user of the program to enter text?

a)

readLine

b)

readln

c)

text

d)

println

12.

To ask the user of the program for a number, which function should you use?

a)

readLine

b)

readInt

c)

readFloat

d)

Both readInt and readFloat are for numbers

13.

What function do you need to call to get the width of the screen?

a)

width()

b)

getWidth()

c)

screenWidth()

d)

getScreenWidth()

14.
Which 1 of the following symbols is used for JavaScript comments?
a)
\\
b)
^
c)
?
d)
//
15.

What is the name of this function?

a)

function

b)

spin()

c)

3 turnLeft();

d)

spin();