Where do we use the return value from $.each() (not to be confused with $.fn.each)? I've never seen it used in that context (have for $.map, naturally).
--John On Thu, Jan 15, 2009 at 3:44 PM, Ariel Flesler <[email protected]> wrote: > > I agree with Dave, $.each already returns data so changing it would > break old code (even our own). > Also.. I think we should not mess with $.each, as it's the most > frequently called function all over the framework. > > On Thu, Jan 15, 2009 at 6:14 PM, John Resig <[email protected]> wrote: >> >> I think there was a slight mis-communication, I'll open it back up. >> >> --John >> >> >> >> On Thu, Jan 15, 2009 at 3:11 PM, ajpiano <[email protected]> wrote: >>> >>> http://dev.jquery.com/ticket/3877 >>> >>> The response ths ticket got isn't what I would have expected it to get >>> based on the reactions in this thread? Wha happen? >>> >>> --adam >>> >>> On Dec 18 2008, 8:11 pm, oliver <[email protected]> wrote: >>>> I suppose this is only changing thereturnvalue 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 thereturnvalue? >>>> $.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 ) >>>> > > returnfalse; >>>> > > }); >>>> >>>> > > if ( ret == false ) { >>>> > > // do something >>>> > > } >>>> >>>> > > thereturnvalue will only equal false if areturnfalse was done to >>>> > > break the loop. >>>> >>>> > > --John >>>> >>>> > -- >>>> > Ariel Fleslerhttp://flesler.blogspot.com >>> > >>> >> >> > >> > > > > -- > Ariel Flesler > http://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 -~----------~----~----~----~------~----~------~--~---
