From: Aleks Kissinger Date: 2006-07-26T23:30:41+09:00 Subject: Truncate an array Is there a generally preferred way to truncate an array? I've used these two, but is there a better way? SOME_ARRAY = [1, 2, 3] 1. SOME_ARRAY.each_index{|i| SOME_ARRAY[i].nil}.compact! 2. SOME_ARRAY.slice!(1..0) => SOME_ARRAY == []