reject with block logic : reject « Array « Ruby






reject with block logic


a = ["a", "b", "c", "d", "e", "f", "g", "h"]
p a.reject { |x| x < "e" }         # => ["e", "f", "g", "h"]

 

Related examples in the same category

1.reject the even ones