Throwing StopIteration in array extras to stop the iteration

Rick Waldron waldron.rick at gmail.com
Mon Mar 4 11:32:36 PST 2013


On Mon, Mar 4, 2013 at 11:29 AM, Jeff Walden <jwalden+es at mit.edu> wrote:

> On 03/03/2013 06:49 PM, Rick Waldron wrote:
> > Is this +1 to findIndex?
>
> Not that I much care between the two, just making sure another reasonable
> name is considered, but I'm not sure why it wouldn't be named "find" rather
> than "findIndex".


Because "find' isn't "findIndex"—find would return the element, findIndex
would return the index.

Rick


> The index seems like the only bit you'd reasonably be looking to find.
>  (Well, maybe existence, but I'd expect a name like "contains" for that, or
> just indexOf !== -1.)
>
> Jeff
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130304/0c9a196c/attachment.html>


More information about the es-discuss mailing list