I suppose this is only changing the return value of $.each, not $
([elem]).each(), correct? It does seem useful to have access to that,
but can't this line above:
$.each(col, cb);
be re-written in a nested function in such a way as to get the access
to the return value?
$.each(col, function(i, n) { var result = cb.call(this); });
oliver
On Dec 18, 6:03 am, "Ariel Flesler" <[email protected]> wrote:
> Ah... sort of an (inverted) detect/any function....
>
> Ok, why not :)
>
>
>
> On Thu, Dec 18, 2008 at 11:58 AM, John Resig <[email protected]> wrote:
>
> >> Isn't that what $.map does ?
>
> > Not really. He wants it so that you can do:
>
> > var ret = $.each(array, function(){
> > if ( this == someValue )
> > return false;
> > });
>
> > if ( ret == false ) {
> > // do something
> > }
>
> > the return value will only equal false if a return false was done to
> > break the loop.
>
> > --John
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---