From: Lyle Johnson Date: 2001-11-10T01:08:01+09:00 Subject: [ruby-talk:24773] Re: Strange behaviour of Array#[] > > Why does a[3,1] returns [] instead of nil? > > I believe it's for consistency with Strings: This is still pretty squirrelly to me, but hey, it's not my language ;) It would probably be good to update the descriptions of Array#[] and String#[] for future editions of "Programming Ruby" to note this feature; the current descriptions for both state that if the starting index is out of range that [] will return nil.