wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JavaScript Scope, Arrays, Loops, and Iterators

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Repeating a task multiple times in programming is known as ?

a)

Iterators

b)

Scope

c)

Looping

2.

When JavaScript begins counting with 0, it is known as ?

a)

Zero-indexed

b)

Arrow Function

c)

Looping

3.

Refers to where a variable can be accessed in a program.

a)

Arrays

b)

Scope

c)

Iterators

4.

A variable defined in the block {} is only accessible within the curly braces is known as ?

a)

Infinite Loop

b)

Arrow Function

c)

Block Scope

5.

When there is an error in the logic of the loop because the stopping condition is never reached.

a)

Arrays

b)

Infinite Loop

c)

Looping

6.

When we can change the contents of an array, but cannot reassign the variable name to a new array or other data type.

a)

Muteable

b)

Arrow Function

c)

Global Scope

7.

All iterator methods can be written using ? syntax.

a)

Zero-indexed

b)

Global Scope

c)

Arrow Function

8.

Refers to variables that are accessible to every part of the program.

a)

Global Scope

b)

Block Scope

c)

Muteable

9.

This is JavaScript's way of making lists.

a)

Scope

b)

Iterators

c)

Arrays

10.

These complete such tasks as altering each element and selecting elements that fit certain criteria.

a)

Scope

b)

Iterators

c)

Arrays

11.

While some variables can be accessed from anywhere within a program, other variables may only be available in a specific context.

a)

True

b)

False

12.

Scope depends entirely on where a variable is declared.

a)

True

b)

Flase

13.

Arrays can only store certain types of data.

a)

True

b)

False

14.

Each item in an array has a numbered position.

a)

True

b)

False

15.

.length allows us to add items to the end of an array.

a)

True

b)

False

16.

Arrays are lists and are a way to store data in JavaScript.

a)

True

b)

False

17.

.push allows you to see how many items are in an array.

a)

True

b)

False

18.

.pop removes items from an array.

a)

True

b)

False

19.

We can make our loop run backward by using -- instead of ++.

a)

True

b)

False

20.

The scope brings the loop from start to stop.

a)

True

b)

False

21.

for loops allow us to repeat a block of code a known amount of times.

a)

True

b)

False

22.

It is a best practice to give parameters descriptive names so that other developers who read your code can easily understand what it does.

a)

True

b)

False

23.

.filter() executes the same code on every element in an array and returns a new array with updated elements.

a)

True

b)

False

24.

.map() checks every element in an array to see if it meets certain criteria and returns a new array with the elements that returns truthy for the criteria.

a)

True

b)

False

25.

Variables defined in the global scope are declared outside of a set of curly braces and are available throughout a program.

a)

True

b)

False

26.

Each item inside of an array is at a numbered position, starting at ?

a)

1

b)

0

27.

To compare items in two arrays, we use _____ for loops.

a)

invested

b)

arrayed

c)

nested

28.

_____ loops let us loop a block of code a known amount of times.

a)

while

b)

for

29.

As long as the condition evaluates to _____, the block of code will loops.

a)

true

b)

false

30.

_____ loops let us loop a block of code an unknown amount of times.

a)

for

b)

while