wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript Basics

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

Which is the right way to make a for loop?

a)

Alienisation, The End, Rebels

b)

Installation, Ending, Timer

c)

Intialisation, End Condition, Counter

d)

Initialisation, Counter, End Condition

2.

A loop that executes for a pre-defined number of times

(a)  

3.

A loop that executes until a condition is met is called

(a)  

4.

Which of the below are types of loops

a)

if then else

b)

while loop

c)

for loop

5.

Nested loops are

a)

Multiple independent loops

b)

Conditions in a loop

c)

Loop in a Loop

d)

Loop in a condition

6.

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


How many times will this loop execute

a)

51 times

b)

49 times

c)

50 times

d)

0 times

7.

Which of the iterations runs 25 times

a)

for ( var i = 2; i < 26; i ++ )

b)

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

c)

for ( var i = -1 ; i > 25 ; i -- )

d)

for ( var i = 0; i <= 25; i --)

8.

One of the below functions lets you climb 1000 feet

a)

for ( var count = 0; count > 999; count --)

moveUpOneFoot();

}

b)

for ( var count = 2; count <= 1001; count ++)

moveUpOneFoot();

}

c)

for ( var count = 1000; count < 1; count --)

moveUpOneFoot();

}

d)

for ( var count = 0; count < 1000; count ++)

moveUpOneFoot();

}

9.

Declare a variable called Number and assign it the value: "TwentyFive"

(a)  

10.

How do you define a function in JavaScript

a)

function = climbUp();

b)

fun = "climbUp";

c)

function climbUp();

d)

fun = (climbUp());