Array Index Quiz
What is an array index?
An index refers to the position of a value in an array. Programmers can use the bracket syntax () after an array to retrieve the value at a specific index in the array.
What is the index of the first item in an array?
The first item in an array is at index 0. In Ruby, we start counting at 0, not at 1.
Given our_array = [1, 2, 3, 4, 5], what will the following return?
5 # negative indices return values from the end of the array, starting at -1
nil # nil means nothing! You'll learn more about this in the next section.
Given our_array = ["a", "b", "c"], how would you retrieve the second value ("b") from our_array?