Possible Duplicate:
Array slicing in Ruby: looking for explanation for illogical behaviour (taken from Rubykoans.com)
I have a simple array object:
array = [:peanut, :butter, :and, :jelly]
Its length is, clearly, 4!
Now, take a look at these statements:
array[4,0] == []
array[5,0] == nil
Slicing the array from 4th index, it returns an empty array, but starting from 5th element, it returns nil. Why this happens?