Here are some things you learnt in the last exercise:
a[0]a[-1]nil (instead of an error in other languages)a[1..-1] is everything but the first elementArrays have many useful (and largely self-explanatory) methods, including:
empty? - does the array have any elements, or is it the empty array []lengthinclude?(x) - is x in the arrayreverse, reverse! - as with strings the ! permanenty changes the arraya[5] = 6If the array isn’t long enough the gaps are filled with nil:
a = [1, 2]
a[6] = 5
a #=> [1, 2, nil, nil, nil, nil, 5]
a << 5. This is very ‘rubyish’ and you’ll see it a lot.