wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Javascript Arrays

Total questions: 12

Worksheet time: 7mins

Name
Class
Date
1.

An array is;

a)

A shape

b)

A size

c)

A series of numbers

d)

A list of information

2.

What is first index value of an array?

a)

-1

b)

0

c)

1

d)

undefine

3.

In Javascript, what surrounds an array?

a)

Quotations

b)

Curly Brackets

c)

Parenthesis

d)

Square Brackets

4.
array = [1,2,3,4,5]
What is the length of this array?
a)
5
b)
4
c)
0
d)
125.4
5.

Which definition below best describe an array?

a)

An array is a function identifier that can hold more than one parameter.

b)

An array is a beam of light.

c)

An array is a special variable, which can hold more than one value at a time.

d)

An array is a special function, which can hold more than one value at a time.

6.

What is proper syntax for declaring a array in JavaScript?

a)

var arrayName =[ ];

b)

var arrayName[ ] ={ };

c)

array arrayName ={ };

d)

obj var arrayName =[ ];

7.

Which of the variables below is an array?

a)

var names="array"

b)

var names = array;

c)

var names = [];

d)

var names[];

8.
How would you change the first element in an array?
a)
nums[1] = "New!";
b)
nums = "New!";
c)
var nums[1] = "New!";
d)
nums[0] = "New!";
9.
array = [1,2,3,4,5];
What is the highest position in this array?
HINT: Remember arrays start at position 0!
a)
4
b)
5
c)
0
d)
125.7
10.
What property tells you how many items are in an array?
a)
length
b)
count
c)
items
d)
num
11.

How would you access the second element in an array?

a)

nums.2

b)

nums[2]

c)

nums_1

d)

nums[1]

12.
Which of these lines of code show how to validly store an array with 3 items?
a)
var nums = [42, 3, 7];
b)
var nums = 3, 42, 7;
c)
var nums = [3];
d)
var nums = (3, 42, 7);