Arrays are confusing me.

When you type a number to a text field to search in an array, does it look for the exact number you typed or does it count the number of array items?

When I type in the number 12, does it look for the number 12 like this (aryMonths[12] ) , OR does it count 12 times, starting at zero?

If I start from 0 and count 12 times it still takes me to December. Why does this code have return aryMonths[NUM-1];


<input type="button" value="Convert to Dollars" onclick="EnterMonth();">

Function MonthAsString(NUM)
var aryMonths = new Array();
aryMonths[0] = "January";
aryMonths[1] = "February";
aryMonths[2] = "March";
aryMonths[3] = "April";
aryMonths[4] = "May";
aryMonths[5] = "June";
aryMonths[6] = "July";
aryMonths[7] = "August";
aryMonths[8] = "September";
aryMonths[9] = "October";
aryMonths[10] = "November";
aryMonths[11] = "December";

return aryMonths[NUM-1];