JavaScript in 60 Seconds

Data Types: Array

An array is a list of items.

let fruit = ['oranges', 'apples', 'bananas']; let numbers = [13, 15, 17]; let mixed = [13, 15, 'five', 17]; // You can store any data type in an array, including another array. let nested = [['first', true], ['second', false]];

You can retrieve values by using the index of the item. Array index starts at 0.

let countries = ['USA', 'France', 'Germany']; countries[0]; // -> USA countries[1]; // -> France countries[2]; // -> Germany