1
00:00:00,450 --> 00:00:07,660
JavaScript arrays are used to store multiple values in a single variable in this example.

2
00:00:07,670 --> 00:00:13,580
We've created an array variable called fruits and stored six values into it.

3
00:00:13,730 --> 00:00:23,770
Each value contains the name of a fruit the six values we have our apple orange pear grape tangerine

4
00:00:23,830 --> 00:00:24,400
and mango

5
00:00:27,200 --> 00:00:30,630
in order to output a specific value in the array.

6
00:00:30,740 --> 00:00:37,450
We can refer to it using an index number the index number starts with zero.

7
00:00:37,600 --> 00:00:42,540
The first item in the array is identified by the index number zero.

8
00:00:42,550 --> 00:00:50,560
In this case Apple if the index number was one we would be referencing orange and so on.

9
00:00:53,580 --> 00:00:58,410
Since we've used an index number of 0 when we preview this in our web browser

10
00:01:03,040 --> 00:01:05,890
we'll see that the word apple is displayed.

11
00:01:05,890 --> 00:01:12,640
This is the first item in the array if we change the index number to three

12
00:01:18,570 --> 00:01:25,370
we'll see that the the word displayed in our web browser changes to grape

13
00:01:33,740 --> 00:01:40,900
and that's how we reference individual items in the array.

14
00:01:40,970 --> 00:01:47,000
In this situation where we wanted to display the number of items in the array.

15
00:01:47,000 --> 00:01:49,520
So for example here we have six items

16
00:01:52,410 --> 00:01:56,310
we can use the length property we've used the length property before

17
00:02:02,010 --> 00:02:11,550
and when we save the file and refresh the page we can see that the number 6 has been output because

18
00:02:11,550 --> 00:02:13,170
there are six items in the array.
