A pattern to destructively extract items from an array
Array.partition returns an array of two arrays - one where the elements returned true to the condition, and one that returned false.

So, a single liner for your need would be:

odds, ary = (0..9).to_a.partition(&amp;:odd?)
=&gt; [[1, 3, 5, 7, 9], [0, 2, 4, 6, 8]] 


(&amp;:odd?) acts exactly like writing { |x| x.odd? } which will return true if the number is, well, odd...