Hmm, it' is the prototype way of doing it. I suppose it has to do with
writing beautiful code, but that might be a matter of taste. Some like
it and some don't :-)

On Wed, Jan 19, 2011 at 11:59 PM, T.J. Crowder <t...@crowdersoftware.com> wrote:
> @Rüdiger:
>
>> And last but not least, if this is a prototype mailing list you should
>> of course use prototype, so your loops would look like this:
>> $A(array_b_length).each(function(arrayElement) {
>>    // do something with the element...
>> });
>
> Whether I'm using Prototype or not, I don't need to create a function
> and incur the overhead of a function call on every iteration (not to
> mention the complications around `this`) just to loop through an
> array. People are free to do that if they like, but it's not remotely
> necessary and it's certainly not always appropriate. There's nothing
> wrong with a nice, simple `for` loop.
>
> Just my two cents.
> --
> T.J. Crowder
> Independent Software Engineer
> tj / crowder software / com
> www / crowder software / com
>
> On Jan 19, 3:18 pm, Rüdiger Kaatz <rudirak...@gmail.com> wrote:
>> And last but not least, if this is a prototype mailing list you should
>> of course use prototype, so your loops would look like this:
>>
>> $A(array_b_length).each(function(arrayElement) {
>>   // do something with the element...
>>
>>
>>
>>
>>
>>
>>
>> });
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to