Prototype.K is just an empty function. So if iterator is not defined
it will just use an empty function instead. The !!() forces the
returned value of the function to be a boolean.
Hope that breif description helps.
Brandon
On 9/22/06, Nathaniel Brown <[EMAIL PROTECTED]> wrote:
>
> I am interested in finding out what this actually does?
>
> if (result = !!(iterator || Prototype.K)(value, index))
>
> I seen this function in the Prototype library and haven't been able to
> find any documentation to gain insight into what the line above does.
>
> any: function(iterator) {
> var result = false;
> this.each(function(value, index) {
> if (result = !!(iterator || Prototype.K)(value, index))
> throw $break;
> });
> return result;
> },
>
> More specifically it is the ... !!(iterator || Prototype.K)(value,
> index) ... piece of code that confuses me.
>
> -NSHB
>
>
> --
> Nathaniel Steven Henry Brown
>
> Open Source Insight - http://nshb.net
> Open Source Development - http://inimit.com
> Open Source Training - http://osevents.com
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---