From: Farrel Lifson Date: 2007-04-02T22:23:59+09:00 Subject: Re: Map Or Collect Redux On 02/04/07, Nicholas Milkovits wrote: > arr = [1, 2, 3, 4, 5] > arr.collect { |x| if x%2 == 0 then x end }.compact > => [2, 4] > # Seems like maybe it should be .filter instead of .collect This is more appropriate for Array#select (or reject). Personally I use map exclusively. Farrel