wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Arrays

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

_________________ is a collection of elements used to store the same type of data.

a)

Array

b)

Switch

c)

Case

d)

Loop

2.

What is returned by values[5]?

a)

2

b)

12

c)

6

d)

8

3.

var nums =[2, 3, 5, 8, 9, 11];

How would you access the fourth element in nums

a)

nums[4]

b)

nums[3]

c)

nums(4)

d)

nums(3)

4.

X is ?

a)

Array

b)

Variable

5.

X is ?

a)

Array

b)

variable

6.

............. is a placeholder for only one data?

a)

Array

b)

Variable

7.

.......... is a placeholder for related data?

a)

Array

b)

variable

8.

which option represent: Array holding a String data?

a)
b)
9.

Arrays are containers of slots each slot can have two value.

a)

True

b)

False

10.

Allowed to create an empty array and then add values

a)

True

b)

False

11.

Arrays in JavaScript are zero-indexed which means the first index is 0.

a)

True

b)

False

12.

var nums =[2, 3, 5, 8, 9, 11];

How would you access the first element in nums

a)

num(1);

b)

num[1];

c)

num(0);

d)

num[0];

13.

x is array of 10 items, to access the last index ?

a)

x[10];

b)

x(10);

c)

x[9];

d)

x(9);

14.

using (appendItem) will add the new item to the ........ of the array

a)

First

b)

Middle

c)

End

15.

Entire array is enclosed in:

a)

( )

b)

{ }

c)

[ ]

16.

values in arrays are separated with

a)

;

b)

,

c)

-

d)

/

17.

what is the result of :

nums[1]+nums[3]

a)

3

b)

14

c)

6

d)

5

18.

what will be the array after executing this line ?

names[1] = "Sarah";

a)
b)
c)
19.

what will be the array after executing this code?

appendItem(names, "Sarah");

a)
b)
c)
20.

what will be the array after executing this code?

removeItem(names, 3);

a)
b)
21.

what will be the array after executing this code?

insertItem(names, 1 , "Ahmed");

a)
b)
c)