From: "Jan E." Date: 2012-04-13T16:53:10+09:00 Subject: Re: How to test if array element exists? Hi, If you access a non-existing index, you get nil. That is, your expression [array[4]] evaluates to [nil], which is not empty (but has exactly one element). The only way to test for existence is to check the length of the array: if 4 >= array.length puts 'no index 4' end -- Posted via http://www.ruby-forum.com/.