Tobias Reif <tobiasreif / pinkjuice.com> writes:

> Is there something like
>    Array#any?
> ?
> 
> [3,1,5].any? {|el| el == 1} #=> true
> [3,1,5].any? {|el| el == 4} #=> false
> 
> ['foozboozer','hubbabubba'].any? {|el| el =~ /oo/} #=> true
> ['foozboozer','hubbabubba'].any? {|el| el =~ /\d+/} #=> false
> 
> Tobi

I don't see anything that looks like any? in the built-in methods, so:

class Array
  def any?
     self.each { |el| return true if yield el }
     return false
  end
end


YS.