Arrays and Loops

Array

Create an empty array:
var yourArray = [];
Add an item to an array:
yourArray.push(someItem);
Get an item from an array:
yourArray[someIndexNumber]
Get the size of an array:
yourArray.length

Loop

Do something n times:
for (var i = 0; i < n; i++) {
    // write code here to do something n times
    // the variable i will increase by 1 each time
}
Loop through an array:
for (var i = 0; i < yourArray.length; i++) {
    // write code here to do something with each item in the array
    // use yourArray[i] to get each item in the array
}