On Sat, Jan 29, 2011 at 6:45 AM, Lucky Dev <lucky.developer / gmail.com>wrote:

> I'm using ruby 1.9.2 Today i was playing around array and here is the
> console log.
>
> [...]
>
> a[6,1] or a[6,n] should give 1 or n elements from 6th index. There is no
> element in 6th index. so it must return a nil.
> It should be the same for a[7,1] or a[7,n] and for this a[7,n] it
> returns nil.
>
> Both a[6] a[7] does not exist in array. can you explain why there is a
> difference in slicing output above.
>

There was a discussion about this that you can read:
http://www.ruby-forum.com/topic/216796

It's not actually specific to 1.9, if you're wondering.