Two ways to declare an array
// Declaring an empty array using the Array constructor syntax
var names = new Array();
// Declaring an empty array using literal notation (preferred)
var names = [];
// Declaring an array using literal notation with data
var names = ['larry', 'curly', 'moe'];
The best practice is to use the literal notation whenever possible
Arrays are “zero-based” meaning indexes start at 0
// the value 'curly' is said to have an index of 1
var names = ['larry', 'curly', 'moe'];
The most common way to retrieve a single value from an array is to use the index
var names = ['larry', 'curly', 'moe'];
// retrieve the first item out of the array
names[0]; // this wil return 'larry'