Computers start counting from zero. So 0 is 1, 1 is 2, and so on. That’s why list[2]
selects item 3
from the array
Code for the array in the example:
var list = ['item 1', 'item 2', 'item 3', 'item 4']
Computers start counting from zero. So 0 is 1, 1 is 2, and so on. That’s why list[2]
selects item 3
from the array
Code for the array in the example:
var list = ['item 1', 'item 2', 'item 3', 'item 4']