find all odd elements : find_all « Range « Ruby






find all odd elements


(1..8).find_all {|x| x%2==1}  # => [1,3,5,7]: find all odd elements

 

Related examples in the same category