Arrays are similar to Lists in Python, they are a way to store multiple values in a single variable.
var city = ["Centennial", "Littleton", "Highlands Ranch"];
Arrays, like strings, use indexes to keep track of position. They also start with index 0.
var city1 = city[0];
would give you Centennial.
var city[0] = "Denver";
would change the first item (index 0) from Centennial to Denver.
There are various array methods. You can find lengths of arrays:
var city = ["Centennial", "Littleton", "Highlands Ranch"];
city.length;
would return 3.
You can add to arrays using push:
var city = ["Centennial", "Littleton", "Highlands Ranch"];
city.push("Denver");
Note that arrays are a special kind of Object in JavaScript. Objects are name:value pairs, and use braces.
var name = {firstname: "Karl", lastname: "Fisch", age:52}
Objects are equivalent to dictionaries in Python. You can access items in objects by using the name part of a pair:
var first = name.firstname;