I have a question about the hint given in Loops and Arrays I.
Step 4 states:
The for loop runs until i < 4 (because cities.length equals 4. The array cities has 4 elements in it; see the Hint for more.)
I figured I probably knew what the Hint would say, but went to check:
The length of the cities array is 4. But when we are accessing the array, the last index position of the array is array—zero-based indexing! Keep this in mind!
I understood this part, but below that was this reminder:
Remember, arrays look like this:
var arrayName = [1, 2, 3];
Should this be
var arrayName = [0, 1, 2, 3];?
If not, can someone explain to me what I am missing here?
Replace this line with your code.