I am noodling with the Ruby Koans and I ran across an Array slice
behavior that I just can't quite wrap my brain around:
ruby-1.9.2-p180 :102 > array = [:peanut, :butter, :and, :jelly]
=> [:peanut, :butter, :and, :jelly]
ruby-1.9.2-p180 :103 > array[4,0]
ruby-1.9.2-p180 :104 > array[5,0]
"Returns nil if the index (or starting index) are out of range."
I don't understand why the 4th element is an empty array, whereas the
5th element is out of range. I would expect the 4th element to be out
of range as 'array' contains elements 0-3.
Can someone plz explain?