From: Love U Ruby Date: 2013-02-24T21:26:00+09:00 Subject: Re: Confusion with `nil` value being produced by IRB in case of Array#size manipulation. Hans Mackowiak wrote in post #1098729: > its because ruby does not make a difference in Array#[] if the element > is nil or non existendt ... > > array = [nil] > array[0] #=> nil > > array[1] #=> nil > > see? there is no difference and no error! Humm @Hans- I just noticed one point which is that, whenever Ruby finds an index which is "out of index" , instead throwing an exception it only prints `nil`.But yes it is the case only when we are reading the element from an index which is still not present in the array. -- Posted via http://www.ruby-forum.com/.