Forum: Rails Spinoffs (closed, excessive spam) Array.in_array ?

Posted by louis w (Guest)
on 2008-06-27 21:09
(Received via mailing list)
Is there any intentions of adding a method which operates like the php
in_array.
Posted by Justin Perkins (Guest)
on 2008-06-27 21:19
(Received via mailing list)
On Fri, Jun 27, 2008 at 2:09 PM, louis w <louiswalch@gmail.com> wrote:
>
> Is there any intentions of adding a method which operates like the php
> in_array.

That's what Enumerable#include is for.

-justin
Posted by louis w (Guest)
on 2008-06-27 21:22
(Received via mailing list)
Brilliant thanks. I thought it was weird that it was not there. I was
looking in the wrong place.
Posted by kangax (Guest)
on 2008-06-27 21:34
(Received via mailing list)
As well as native Array.prototype.indexOf

-- kangax
This topic is locked and can not be replied to.